redis定时
This commit is contained in:
@@ -220,7 +220,7 @@ namespace Tnb.ProductionMgr
|
||||
}
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Readtimer = new Timer(GetRedisData, null, TimeSpan.Zero, TimeSpan.FromSeconds(5));
|
||||
Readtimer = new Timer(GetRedisData, null, TimeSpan.Zero, TimeSpan.FromMinutes(5));
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
public Task StopAsync(CancellationToken cancellationToken)
|
||||
|
||||
@@ -57,7 +57,7 @@ public class Startup : AppStartup
|
||||
|
||||
//定时任务
|
||||
services.AddHostedService<TimedTaskBackgroundService>();
|
||||
//services.AddHostedService<RedisBackGround>();
|
||||
services.AddHostedService<RedisBackGround>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user