mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-06 20:48:23 +00:00
Unregister stateless agents from server on termination (#2606)
Closes #2027 --------- Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
@@ -34,10 +34,10 @@ func WithContextSigtermCallback(ctx context.Context, f func()) context.Context {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
case <-receivedSignal:
|
||||
cancel(fmt.Errorf("received signal: %v", receivedSignal))
|
||||
if f != nil {
|
||||
f()
|
||||
}
|
||||
cancel(fmt.Errorf("received signal: %v", receivedSignal))
|
||||
}
|
||||
}()
|
||||
|
||||
|
Reference in New Issue
Block a user