fix: drain background queue before exiting on failure (#3528)
* Initial plan * fix: drain the background queue before exiting on failure Co-authored-by: dominikschulz <1449175+dominikschulz@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: dominikschulz <1449175+dominikschulz@users.noreply.github.com>
This commit is contained in:
@@ -86,15 +86,18 @@ func main() {
|
||||
ctx = queue.WithQueue(ctx, q)
|
||||
ctx, app := setupApp(ctx, sv)
|
||||
|
||||
if err := runApp(ctx, app); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
runErr := runApp(ctx, app)
|
||||
|
||||
// process all pending queue items
|
||||
// process all pending queue items, even on failure: a command can have written a
|
||||
// secret before erroring, and its commit/push is queued at this point.
|
||||
_ = q.Close(ctx)
|
||||
|
||||
writeMemProfile()
|
||||
|
||||
if runErr != nil {
|
||||
log.Fatal(runErr)
|
||||
}
|
||||
|
||||
debug.Log("gopass %s shutting down ...\n\n", sv.String())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user