From a0a6a13812f97cb9887185c10ee85709e70d842d Mon Sep 17 00:00:00 2001 From: zyxkad Date: Fri, 3 May 2024 23:22:07 -0600 Subject: [PATCH] emit disable before exit --- handler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/handler.go b/handler.go index 10985580..0cae50f3 100644 --- a/handler.go +++ b/handler.go @@ -543,6 +543,8 @@ func (cr *Cluster) handleDownload(rw http.ResponseWriter, req *http.Request, has } if err == storage.ErrNotWorking { log.Errorf("All storages are down, exit.") + tctx, _ := context.WithTimeout(context.TODO(), time.Second * 10) + cr.Disable(tctx) osExit(CodeClientOrEnvionmentError) } return