forgejo-runner/internal/pkg
rowan-allspice 30029567f7
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>
(cherry picked from commit d1d3cad4b0bfd0bfc5df344306f304043ff63223)

Conflicts:
	internal/pkg/config/config.example.yaml
	internal/pkg/config/config.go
	scripts/run.sh
	trivial context conflicts
2024-06-03 15:14:50 +02:00
..
client ci(lint): refactor code for clarity and linting compliance (#289) 2023-07-13 01:10:54 +00:00
config feat: allow graceful shutdowns (#546) 2024-06-03 15:14:50 +02:00
envcheck typo in error message 2024-05-03 09:54:34 +02:00
labels [FORGEJO] add support for the lxc:// scheme 2023-11-09 03:55:09 +01:00
report Update tests 2024-04-20 08:21:35 +02:00
ver Refactor to new framework (#98) 2023-04-04 21:32:04 +08:00