File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
src/Infrastructure/BotSharp.Core.Crontab/Services Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 3232 <PackageVersion Include =" Serilog.Sinks.File" Version =" 6.0.0" />
3333 <PackageVersion Include =" Rougamo.Fody" Version =" 5.0.0" />
3434 <PackageVersion Include =" Aspects.Cache" Version =" 2.0.4" />
35- <PackageVersion Include =" DistributedLock.Redis" Version =" 1.0.3 " />
35+ <PackageVersion Include =" DistributedLock.Redis" Version =" 1.1.0 " />
3636 <PackageVersion Include =" EntityFrameworkCore.BootKit" Version =" 8.9.0" />
3737 <PackageVersion Include =" Fluid.Core" Version =" 2.11.1" />
3838 <PackageVersion Include =" Nanoid" Version =" 3.1.0" />
8484 <PackageVersion Include =" MySqlConnector" Version =" 2.4.0" />
8585 <PackageVersion Include =" Npgsql" Version =" 8.0.7" />
8686 <PackageVersion Include =" Tencent.QCloud.Cos.Sdk" Version =" 5.4.39" />
87- <PackageVersion Include =" StackExchange.Redis" Version =" 2.7.27 " />
87+ <PackageVersion Include =" StackExchange.Redis" Version =" 2.7.33 " />
8888 <PackageVersion Include =" StrongGrid" Version =" 0.108.0" />
8989 <PackageVersion Include =" Twilio.AspNet.Common" Version =" 8.1.1" />
9090 <PackageVersion Include =" Twilio.AspNet.Core" Version =" 8.1.1" />
Original file line number Diff line number Diff line change @@ -31,11 +31,15 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
3131
3232 while ( ! stoppingToken . IsCancellationRequested )
3333 {
34- await locker . LockAsync ( DIST_KEY , async ( ) =>
34+ var isLocked = await locker . LockAsync ( DIST_KEY , async ( ) =>
3535 {
3636 await RunCronChecker ( scope . ServiceProvider ) ;
3737 await Task . Delay ( 1000 , stoppingToken ) ;
3838 } ) ;
39+ if ( isLocked == false )
40+ {
41+ await Task . Delay ( 1000 , stoppingToken ) ;
42+ }
3943 }
4044
4145 _logger . LogWarning ( "Crontab Watcher background service is stopped." ) ;
You can’t perform that action at this time.
0 commit comments