Tinkoff / Horarium

Horarium is the .Net library to manage background jobs
Apache License 2.0
56 stars 12 forks source link

Respect host's ShutdownTimeout (e.g. cancellation token) when stopping jobs #42

Closed Tolyandre closed 4 years ago

Tolyandre commented 4 years ago

We made a graceful stopping in #41. This PR adds respect to ShutdownTimeout by using a cancellation token from IHostedService.StopAsync(). Thus Horarium will abandon awaiting jobs after the timeout. This way feels consistent with .Net core.

codecov-io commented 4 years ago

Codecov Report

Merging #42 into master will increase coverage by 0.46%. The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #42      +/-   ##
==========================================
+ Coverage   69.39%   69.85%   +0.46%     
==========================================
  Files          32       32              
  Lines         905      909       +4     
==========================================
+ Hits          628      635       +7     
+ Misses        277      274       -3     
Impacted Files Coverage Δ
...Horarium.AspNetCore/HorariumServerHostedService.cs 0.00% <0.00%> (ø)
src/Horarium/HorariumServer.cs 28.57% <0.00%> (ø)
src/Horarium/Handlers/RunnerJobs.cs 85.33% <100.00%> (ø)
src/Horarium/Handlers/UncompletedTaskList.cs 100.00% <100.00%> (+10.00%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8424c6b...1406ccb. Read the comment docs.