From ca87754ba03e04325797a25e2d897b28fe39a4ff Mon Sep 17 00:00:00 2001 From: problematicconsumer Date: Fri, 27 Oct 2023 17:33:24 +0330 Subject: [PATCH] Fix service restart --- custom/custom.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/custom/custom.go b/custom/custom.go index 9ec5fc2..f184725 100644 --- a/custom/custom.go +++ b/custom/custom.go @@ -190,13 +190,17 @@ func restart(configPath *C.char, disableMemoryLimit bool) (CErr *C.char) { return err } + propagateStatus(Starting) + time.Sleep(250 * time.Millisecond) - err = start(configPath, disableMemoryLimit) - if C.GoString(err) != "" { - return err + path := C.GoString(configPath) + activeConfigPath = &path + libbox.SetMemoryLimit(!disableMemoryLimit) + gErr := startService(false) + if gErr != nil { + return C.CString(gErr.Error()) } - return C.CString("") }