You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
886 B
C#
41 lines
886 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
using StackExchange;
|
|
using StackExchange.Redis;
|
|
using StackExchange.Redis.KeyspaceIsolation;
|
|
|
|
namespace OAuth2Study.Cache.RedisCache
|
|
{
|
|
/// <summary>
|
|
/// Redis缓存
|
|
/// </summary>
|
|
public sealed class RedisManager
|
|
{
|
|
private RedisManager() { }
|
|
|
|
private static RedisManager redisManager;
|
|
|
|
private static readonly object flag = new object();
|
|
|
|
public static RedisManager Instance()
|
|
{
|
|
if (redisManager==null)
|
|
{
|
|
lock (flag)
|
|
{
|
|
if (redisManager==null)
|
|
{
|
|
redisManager = new RedisManager();
|
|
}
|
|
}
|
|
}
|
|
|
|
return redisManager;
|
|
}
|
|
}
|
|
}
|