1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-06-27 16:35:58 +00:00

chore(runner): wait workflow done before shutdown the service

This commit is contained in:
Bo-Yi Wu 2022-11-11 13:51:00 +08:00 committed by Jason Song
parent cbd21b8ec5
commit d1114da299
2 changed files with 8 additions and 4 deletions

View file

@ -138,6 +138,9 @@ func runDaemon(ctx context.Context, envFile string) func(cmd *cobra.Command, arg
})
g.Go(func() error {
// wait all workflows done.
poller.Wait()
// received the shutdown signal
<-ctx.Done()
log.Infoln("update runner status to offline")
_, err := cli.UpdateRunner(