mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-21 02:58:06 +08:00
chore: 升级示例项目为基于 .NET 6.0 的实现
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Medallion.Threading;
|
||||
using Medallion.Threading.FileSystem;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Sample_Net5.Services.DistributedLock.Implements
|
||||
{
|
||||
class DistributedLockFactory : IDistributedLockFactory
|
||||
{
|
||||
private readonly DirectoryInfo _lockFileDirectory = new DirectoryInfo(Environment.CurrentDirectory);
|
||||
|
||||
public IDistributedLock Create(string lockName)
|
||||
{
|
||||
// NOTICE: 单机演示基于文件实现分布式锁,生产项目请替换成其他实现
|
||||
return new FileDistributedLock(_lockFileDirectory, lockName);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user