mirror of
https://gitea.com/gitea/act_runner.git
synced 2025-06-11 09:07:14 +02:00
feat: allow graceful shutdowns (#546)
Add a `Shutdown(context.Context) error` method to the Poller. Calling this method will first shutdown all active polling, preventing any new jobs from spawning. It will then wait for either all jobs to finish, or for the context to be cancelled. If the context is cancelled, it will then force all jobs to end, and then exit. Fixes https://gitea.com/gitea/act_runner/issues/107 Co-authored-by: Rowan Bohde <rowan.bohde@gmail.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/546 Reviewed-by: Jason Song <i@wolfogre.com> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: rowan-allspice <rowan-allspice@noreply.gitea.com> Co-committed-by: rowan-allspice <rowan-allspice@noreply.gitea.com>
This commit is contained in:

committed by
Lunny Xiao

parent
1735b26e66
commit
d1d3cad4b0
@ -54,4 +54,4 @@ fi
|
||||
unset GITEA_RUNNER_REGISTRATION_TOKEN
|
||||
unset GITEA_RUNNER_REGISTRATION_TOKEN_FILE
|
||||
|
||||
act_runner daemon ${CONFIG_ARG}
|
||||
exec act_runner daemon ${CONFIG_ARG}
|
||||
|
Reference in New Issue
Block a user