Remove while true

This commit is contained in:
Nikolay Kochulin 2019-12-07 19:55:22 +00:00
parent 2b17d3925a
commit 47d504faf0

View File

@ -77,7 +77,7 @@ namespace JetKarmaBot.Services
} }
public async Task SaveLoop(CancellationToken ct = default(CancellationToken)) public async Task SaveLoop(CancellationToken ct = default(CancellationToken))
{ {
while (true) while (!ct.IsCancellationRequested)
{ {
await Task.Delay(cfg.Timeout.SaveIntervalSeconds * 1000, ct); await Task.Delay(cfg.Timeout.SaveIntervalSeconds * 1000, ct);
await Save(ct); await Save(ct);