Skip to content

Commit

Permalink
chore: update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandropb36 committed May 11, 2023
1 parent 76870b4 commit 977cf73
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions samples/WebApplicationApiSample/Services/Worker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public Worker(CronWorkerServiceSettings<Worker> cronWorkerServiceSettings, ILogg
protected override async Task DoWork(CancellationToken cancellationToken)
{
var guid = Guid.NewGuid();
_logger.LogInformation("Running Worker1 Task:{0}... at {1}", guid, DateTime.UtcNow);
_logger.LogInformation("Running Worker1 at {date} - Task:{guid}", DateTime.UtcNow, guid);
await Task.Delay(5000);
_logger.LogWarning("Finished Worker1 Task:{0}... at {1}", guid, DateTime.UtcNow);
_logger.LogTrace("Finished Worker1 at {date} - Task:{guid}", DateTime.UtcNow, guid);
}
}
}
3 changes: 1 addition & 2 deletions samples/WebApplicationApiSample/Services/Worker2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ public Worker2(CronWorkerServiceSettings<Worker2> cronWorkerServiceSettings, ILo

protected override Task DoWork(CancellationToken stoppingToken)
{
_logger.LogInformation("Running Worker2... at {0}", DateTime.UtcNow);

_logger.LogInformation("Running Worker2 at {date}", DateTime.UtcNow);

return Task.CompletedTask;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ protected override async Task DoWork(CancellationToken cancellationToken)
}

var guid = Guid.NewGuid();
_logger.LogInformation("Running WorkerWithSemaphore Task:{0}... at {1}", guid, DateTime.UtcNow);
_logger.LogInformation("Running WorkerWithSemaphore at {date} - Task:{guid}", DateTime.UtcNow, guid);
await Task.Delay(5000);
_logger.LogInformation("Finished WorkerWithSemaphore Task:{0}... at {1}", guid, DateTime.UtcNow);
_logger.LogInformation("Finished WorkerWithSemaphore at {date} - Task:{guid}", DateTime.UtcNow, guid);

_semaphoreSlim.Release();
}
Expand Down

0 comments on commit 977cf73

Please sign in to comment.