Skip to content

Commit 6fc17b7

Browse files
authored
Merge pull request #303 from Senparc/Develop
更新 Cache: remove InsertToCache(), add Count(prefix)
2 parents 6313c98 + 0c33540 commit 6fc17b7

File tree

19 files changed

+692
-608
lines changed

19 files changed

+692
-608
lines changed
Lines changed: 50 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
4-
<Version>1.4.5</Version>
5-
<AssemblyName>Senparc.CO2NET.APM</AssemblyName>
6-
<RootNamespace>Senparc.CO2NET.APM</RootNamespace>
7-
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
8-
<Description>
3+
<PropertyGroup>
4+
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
5+
<Version>1.4.6</Version>
6+
<AssemblyName>Senparc.CO2NET.APM</AssemblyName>
7+
<RootNamespace>Senparc.CO2NET.APM</RootNamespace>
8+
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
9+
<Description>
910
Senparc.CO2NET.APM 应用性能管理
1011
</Description>
11-
<Copyright>Senparc Copyright © 2004~2024</Copyright>
12-
<PackageTags>APM,.NET Core,.NET Framework,公共,基础库,CO2NET</PackageTags>
13-
<Authors>Senparc</Authors>
14-
<Owners>Senparc</Owners>
15-
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
16-
<ProjectUrl>https://github.com/Senparc/Senparc.CO2NET</ProjectUrl>
17-
<Title>Senparc.CO2NET.APM.dll</Title>
18-
<Summary>Senparc.CO2NET.APM</Summary>
19-
<PackageProjectUrl>https://github.com/Senparc/Senparc.CO2NET</PackageProjectUrl>
20-
<PackageIcon>icon.jpg</PackageIcon>
21-
<RepositoryUrl>https://github.com/Senparc/Senparc.CO2NET</RepositoryUrl>
22-
<Configurations>Debug;Release;Test</Configurations>
23-
<PackageReleaseNotes>
12+
<Copyright>Senparc Copyright © 2004~2024</Copyright>
13+
<PackageTags>APM,.NET Core,.NET Framework,公共,基础库,CO2NET</PackageTags>
14+
<Authors>Senparc</Authors>
15+
<Owners>Senparc</Owners>
16+
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
17+
<ProjectUrl>https://github.com/Senparc/Senparc.CO2NET</ProjectUrl>
18+
<Title>Senparc.CO2NET.APM.dll</Title>
19+
<Summary>Senparc.CO2NET.APM</Summary>
20+
<PackageProjectUrl>https://github.com/Senparc/Senparc.CO2NET</PackageProjectUrl>
21+
<PackageIcon>icon.jpg</PackageIcon>
22+
<RepositoryUrl>https://github.com/Senparc/Senparc.CO2NET</RepositoryUrl>
23+
<Configurations>Debug;Release;Test</Configurations>
24+
<PackageReleaseNotes>
2425
v0.1.1 支持基础监控数据的记录、调取和整理/清除操作
2526
v0.1.2 DataItem 提供 TempStorage 属性;DataOperation 支持不分域的全局模式
2627
v0.1.3 支持 Senparc.CO2NET v0.3.0
@@ -35,33 +36,34 @@
3536
v0.5.102 支持新版本 CO2NET
3637
v0.6.102 支持新版本 CO2NET
3738
v1.1.0 默认停用 APM(EnableAPM = false)
39+
[2024-09-11] v1.4.6 更新 Cache, remove InsertToCache(), add Count(prefix)
3840
</PackageReleaseNotes>
39-
</PropertyGroup>
40-
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
41-
<OutputPath>..\BuildOutPut</OutputPath>
42-
<DefineConstants>TRACE;RELEASE</DefineConstants>
43-
</PropertyGroup>
44-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
45-
<OutputPath>..\BuildOutPut</OutputPath>
46-
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
47-
<DocumentationFile>..\BuildOutPut\Senparc.CO2NET.APM.xml</DocumentationFile>
48-
<Optimize>true</Optimize>
49-
<DebugType>pdbonly</DebugType>
50-
<ErrorReport>prompt</ErrorReport>
51-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
52-
</PropertyGroup>
53-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net462|AnyCPU'">
54-
<OutputPath>..\BuildOutPut\</OutputPath>
55-
<DocumentationFile>..\BuildOutPut\net462\Senparc.CO2NET.APM.xml</DocumentationFile>
56-
</PropertyGroup>
57-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
58-
<OutputPath>..\BuildOutPut\</OutputPath>
59-
<DocumentationFile>..\BuildOutPut\netstandard2.0\Senparc.CO2NET.APM.xml</DocumentationFile>
60-
</PropertyGroup>
61-
<ItemGroup>
62-
<None Include="..\Senparc.CO2NET\icon.jpg" Pack="true" Visible="false" PackagePath="" />
63-
</ItemGroup>
64-
<ItemGroup>
65-
<ProjectReference Include="..\Senparc.CO2NET\Senparc.CO2NET.csproj" />
66-
</ItemGroup>
41+
</PropertyGroup>
42+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
43+
<OutputPath>..\BuildOutPut</OutputPath>
44+
<DefineConstants>TRACE;RELEASE</DefineConstants>
45+
</PropertyGroup>
46+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
47+
<OutputPath>..\BuildOutPut</OutputPath>
48+
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
49+
<DocumentationFile>..\BuildOutPut\Senparc.CO2NET.APM.xml</DocumentationFile>
50+
<Optimize>true</Optimize>
51+
<DebugType>pdbonly</DebugType>
52+
<ErrorReport>prompt</ErrorReport>
53+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
54+
</PropertyGroup>
55+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net462|AnyCPU'">
56+
<OutputPath>..\BuildOutPut\</OutputPath>
57+
<DocumentationFile>..\BuildOutPut\net462\Senparc.CO2NET.APM.xml</DocumentationFile>
58+
</PropertyGroup>
59+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
60+
<OutputPath>..\BuildOutPut\</OutputPath>
61+
<DocumentationFile>..\BuildOutPut\netstandard2.0\Senparc.CO2NET.APM.xml</DocumentationFile>
62+
</PropertyGroup>
63+
<ItemGroup>
64+
<None Include="..\Senparc.CO2NET\icon.jpg" Pack="true" Visible="false" PackagePath="" />
65+
</ItemGroup>
66+
<ItemGroup>
67+
<ProjectReference Include="..\Senparc.CO2NET\Senparc.CO2NET.csproj" />
68+
</ItemGroup>
6769
</Project>
Lines changed: 78 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>net462;netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
4-
<Version>1.4.2</Version>
5-
<AssemblyName>Senparc.CO2NET.AspNet</AssemblyName>
6-
<RootNamespace>Senparc.CO2NET.AspNet</RootNamespace>
7-
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
8-
<Description>
3+
<PropertyGroup>
4+
<TargetFrameworks>net462;netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
5+
<Version>1.4.3</Version>
6+
<AssemblyName>Senparc.CO2NET.AspNet</AssemblyName>
7+
<RootNamespace>Senparc.CO2NET.AspNet</RootNamespace>
8+
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
9+
<Description>
910
Senparc.CO2NET.AspNet 库
1011

1112
Senparc.CO2NET 开源项目:
1213
https://github.com/Senparc/Senparc.CO2NET
1314
</Description>
14-
<Copyright>Senparc Copyright © 2004~2024</Copyright>
15-
<PackageTags>.NET Core,.NET Framework,公共,基础库,CO2NET,ASP.NET</PackageTags>
16-
<Authors>Senparc</Authors>
17-
<Owners>Senparc</Owners>
18-
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
19-
<ProjectUrl>https://github.com/Senparc/Senparc.CO2NET</ProjectUrl>
20-
<Title>Senparc.CO2NET.dll</Title>
21-
<Summary>Senparc.CO2NET.AspNet 库</Summary>
22-
<PackageProjectUrl>https://github.com/Senparc/Senparc.CO2NET</PackageProjectUrl>
23-
<PackageIcon>icon.jpg</PackageIcon>
24-
<PackageReleaseNotes>
15+
<Copyright>Senparc Copyright © 2004~2024</Copyright>
16+
<PackageTags>.NET Core,.NET Framework,公共,基础库,CO2NET,ASP.NET</PackageTags>
17+
<Authors>Senparc</Authors>
18+
<Owners>Senparc</Owners>
19+
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
20+
<ProjectUrl>https://github.com/Senparc/Senparc.CO2NET</ProjectUrl>
21+
<Title>Senparc.CO2NET.dll</Title>
22+
<Summary>Senparc.CO2NET.AspNet 库</Summary>
23+
<PackageProjectUrl>https://github.com/Senparc/Senparc.CO2NET</PackageProjectUrl>
24+
<PackageIcon>icon.jpg</PackageIcon>
25+
<PackageReleaseNotes>
2526
v0.1.0 构建基础代码,从 Senparc.CO2NET 分离 ASP.NET (以及 ASP.NET Core)代码
2627
v0.4.300.4 提供 GetRequestMemoryStreamAsync() 异步方法
2728
v1.0.1 更新 UseSenparcGlobal 参数输入方式
@@ -30,65 +31,66 @@
3031
2、添加 .NET 6.0 / 7.0 依赖
3132
v1.3.0 升级到 .NET 8.0
3233
v1.4.0 .NET 6.0 和 .NET 8.0 程序集不再依赖 Microsoft.AspNetCore.Hosting.Abstractions 和 Microsoft.AspNetCore.Http.Abstractions
34+
[2024-09-11] v1.4.3 更新 Cache, remove InsertToCache(), add Count(prefix)
3335
</PackageReleaseNotes>
34-
<RepositoryUrl>https://github.com/Senparc/Senparc.CO2NET</RepositoryUrl>
35-
<Configurations>Debug;Release;Test</Configurations>
36-
</PropertyGroup>
37-
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
38-
<OutputPath>..\BuildOutPut</OutputPath>
39-
<DefineConstants>TRACE;RELEASE</DefineConstants>
40-
</PropertyGroup>
41-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
42-
<OutputPath>..\BuildOutPut</OutputPath>
43-
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
44-
<DocumentationFile>..\BuildOutPut\Senparc.CO2NET.AspNet.xml</DocumentationFile>
45-
<Optimize>true</Optimize>
46-
<DebugType>pdbonly</DebugType>
47-
<ErrorReport>prompt</ErrorReport>
48-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
49-
</PropertyGroup>
50-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net462|AnyCPU'">
51-
<OutputPath>..\BuildOutPut\</OutputPath>
52-
<DocumentationFile>..\BuildOutPut\net462\Senparc.CO2NET.AspNet..xml</DocumentationFile>
53-
</PropertyGroup>
54-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
55-
<OutputPath>..\BuildOutPut\</OutputPath>
56-
<DocumentationFile>..\BuildOutPut\netstandard2.0\Senparc.CO2NET.AspNet.xml</DocumentationFile>
57-
</PropertyGroup>
58-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.1|AnyCPU'">
59-
<OutputPath>..\BuildOutPut\</OutputPath>
60-
<DocumentationFile>..\BuildOutPut\netstandard2.1\Senparc.CO2NET.AspNet.xml</DocumentationFile>
61-
</PropertyGroup>
62-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0|AnyCPU'">
63-
<OutputPath>..\BuildOutPut\</OutputPath>
64-
<DocumentationFile>..\BuildOutPut\net8.0\Senparc.CO2NET.AspNet.xml</DocumentationFile>
65-
</PropertyGroup>
66-
<ItemGroup>
67-
<None Include="..\Senparc.CO2NET\icon.jpg" Pack="true" Visible="false" PackagePath="" />
68-
</ItemGroup>
69-
<ItemGroup>
70-
<ProjectReference Include="..\Senparc.CO2NET\Senparc.CO2NET.csproj" />
71-
<PackageReference Include="Microsoft.Extensions.Hosting">
72-
<Version>8.0.0</Version>
73-
</PackageReference>
74-
</ItemGroup>
75-
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
76-
<Reference Include="System.Web" />
77-
<Reference Include="System.Web.Extensions" />
78-
</ItemGroup>
79-
<!--<ItemGroup Condition="'$(TargetFramework)' != 'net462' ">
36+
<RepositoryUrl>https://github.com/Senparc/Senparc.CO2NET</RepositoryUrl>
37+
<Configurations>Debug;Release;Test</Configurations>
38+
</PropertyGroup>
39+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
40+
<OutputPath>..\BuildOutPut</OutputPath>
41+
<DefineConstants>TRACE;RELEASE</DefineConstants>
42+
</PropertyGroup>
43+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
44+
<OutputPath>..\BuildOutPut</OutputPath>
45+
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
46+
<DocumentationFile>..\BuildOutPut\Senparc.CO2NET.AspNet.xml</DocumentationFile>
47+
<Optimize>true</Optimize>
48+
<DebugType>pdbonly</DebugType>
49+
<ErrorReport>prompt</ErrorReport>
50+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
51+
</PropertyGroup>
52+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net462|AnyCPU'">
53+
<OutputPath>..\BuildOutPut\</OutputPath>
54+
<DocumentationFile>..\BuildOutPut\net462\Senparc.CO2NET.AspNet..xml</DocumentationFile>
55+
</PropertyGroup>
56+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
57+
<OutputPath>..\BuildOutPut\</OutputPath>
58+
<DocumentationFile>..\BuildOutPut\netstandard2.0\Senparc.CO2NET.AspNet.xml</DocumentationFile>
59+
</PropertyGroup>
60+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.1|AnyCPU'">
61+
<OutputPath>..\BuildOutPut\</OutputPath>
62+
<DocumentationFile>..\BuildOutPut\netstandard2.1\Senparc.CO2NET.AspNet.xml</DocumentationFile>
63+
</PropertyGroup>
64+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0|AnyCPU'">
65+
<OutputPath>..\BuildOutPut\</OutputPath>
66+
<DocumentationFile>..\BuildOutPut\net8.0\Senparc.CO2NET.AspNet.xml</DocumentationFile>
67+
</PropertyGroup>
68+
<ItemGroup>
69+
<None Include="..\Senparc.CO2NET\icon.jpg" Pack="true" Visible="false" PackagePath="" />
70+
</ItemGroup>
71+
<ItemGroup>
72+
<ProjectReference Include="..\Senparc.CO2NET\Senparc.CO2NET.csproj" />
73+
<PackageReference Include="Microsoft.Extensions.Hosting">
74+
<Version>8.0.0</Version>
75+
</PackageReference>
76+
</ItemGroup>
77+
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
78+
<Reference Include="System.Web" />
79+
<Reference Include="System.Web.Extensions" />
80+
</ItemGroup>
81+
<!--<ItemGroup Condition="'$(TargetFramework)' != 'net462' ">
8082
8183
</ItemGroup>-->
82-
<!--<ItemGroup Condition="('$(TargetFramework)' == 'netstandard2.0') OR ('$(TargetFramework)' == 'netstandard2.1')">-->
83-
<ItemGroup Condition="'$(TargetFramework)' != 'net462' And '$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net8.0'">
84-
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions">
85-
<Version>2.2.0</Version>
86-
</PackageReference>
87-
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions">
88-
<Version>2.2.0</Version>
89-
</PackageReference>
90-
</ItemGroup>
91-
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net8.0'">
92-
<PackageReference Include="Microsoft.AspNetCore.App" />
93-
</ItemGroup>
84+
<!--<ItemGroup Condition="('$(TargetFramework)' == 'netstandard2.0') OR ('$(TargetFramework)' == 'netstandard2.1')">-->
85+
<ItemGroup Condition="'$(TargetFramework)' != 'net462' And '$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net8.0'">
86+
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions">
87+
<Version>2.2.0</Version>
88+
</PackageReference>
89+
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions">
90+
<Version>2.2.0</Version>
91+
</PackageReference>
92+
</ItemGroup>
93+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net8.0'">
94+
<PackageReference Include="Microsoft.AspNetCore.App" />
95+
</ItemGroup>
9496
</Project>

src/Senparc.CO2NET.Cache.CsRedis/ObjectCacheStrategy/BaseRedisObjectCacheStrategy.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static BaseRedisObjectCacheStrategy()
7979
#region 同步方法
8080

8181

82-
[Obsolete("此方法已过期,请使用 Set(TKey key, TValue value) 方法")]
82+
[Obsolete("此方法已过期,请使用 Set(TKey key, TValue value) 方法", true)]
8383
public abstract void InsertToCache(string key, object value, TimeSpan? expiry = null);
8484
public abstract void Set(string key, object value, TimeSpan? expiry = null, bool isFullKey = false);
8585

@@ -94,6 +94,7 @@ static BaseRedisObjectCacheStrategy()
9494
public abstract bool CheckExisted(string key, bool isFullKey = false);
9595

9696
public abstract long GetCount();
97+
public abstract long GetCount(string prefix);
9798

9899
public abstract void Update(string key, object value, TimeSpan? expiry = null, bool isFullKey = false);
99100

@@ -115,12 +116,14 @@ static BaseRedisObjectCacheStrategy()
115116
public abstract Task<bool> CheckExistedAsync(string key, bool isFullKey = false);
116117

117118
public abstract Task<long> GetCountAsync();
119+
public abstract Task<long> GetCountAsync(string prefix);
118120

119121
public abstract Task UpdateAsync(string key, object value, TimeSpan? expiry = null, bool isFullKey = false);
120122

121123
#endregion
122124

123125

126+
#region 同步锁
124127

125128
public override ICacheLock BeginCacheLock(string resourceName, string key, int retryCount = 0, TimeSpan retryDelay = new TimeSpan())
126129
{
@@ -132,5 +135,6 @@ static BaseRedisObjectCacheStrategy()
132135
return await RedisCacheLock.CreateAndLockAsync(this, resourceName, key, retryCount, retryDelay).ConfigureAwait(false);
133136
}
134137

138+
#endregion
135139
}
136140
}

src/Senparc.CO2NET.Cache.CsRedis/ObjectCacheStrategy/RedisHashSetObjectCacheStrategy.cs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,23 @@ public override IDictionary<string, object> GetAll()
273273
}
274274

275275
/// <summary>
276-
/// 获取所有缓存项计数(最多 99999 条)
276+
/// 获取所有缓存项计数
277277
/// </summary>
278278
/// <returns></returns>
279279

280280
public override long GetCount()
281281
{
282-
var keyPattern = GetFinalKey("*");//获取带Senparc:DefaultCache:前缀的Key([DefaultCache]
282+
return GetCount(null);
283+
}
284+
285+
/// <summary>
286+
/// 获取所有缓存项计数
287+
/// </summary>
288+
/// <returns></returns>
289+
290+
public override long GetCount(string prefix)
291+
{
292+
var keyPattern = GetFinalKey(prefix + "*");//获取带Senparc:DefaultCache:前缀的Key([DefaultCache]
283293
var count = base.Client.Keys(/*database: Client.GetDatabase().Database,*/ pattern: keyPattern/*, pageSize: 99999*/).Count();
284294
return count;
285295
}
@@ -290,7 +300,7 @@ public override long GetCount()
290300
/// <param name="key"></param>
291301
/// <param name="value"></param>
292302
/// <param name="expiry"></param>
293-
[Obsolete("此方法已过期,请使用 Set(TKey key, TValue value) 方法")]
303+
[Obsolete("此方法已过期,请使用 Set(TKey key, TValue value) 方法", true)]
294304
public override void InsertToCache(string key, object value, TimeSpan? expiry = null)
295305
{
296306
Set(key, value, expiry, false);
@@ -468,6 +478,11 @@ public override Task<long> GetCountAsync()
468478
return Task.Factory.StartNew(() => GetCount());
469479
}
470480

481+
public override Task<long> GetCountAsync(string prefix)
482+
{
483+
return Task.Factory.StartNew(() => GetCount(""));
484+
}
485+
471486
/// <summary>
472487
/// 设置对象。注意:过期时间对 HashSet 无效!
473488
/// </summary>
@@ -540,7 +555,7 @@ public override async Task UpdateAsync(string key, object value, TimeSpan? expir
540555
/// <summary>
541556
/// _cache.HashGetAll()
542557
/// </summary>
543-
public Dictionary<string,string> HashGetAll(string key)
558+
public Dictionary<string, string> HashGetAll(string key)
544559
{
545560
return base.Client.HGetAll(key);
546561
}

0 commit comments

Comments
 (0)