🐛 os.Exit after returning from the HTTP handler

This commit is contained in:
M. Mert Yildiran 2023-03-13 22:51:48 +03:00
parent a4d35599df
commit 4216f07ec7
No known key found for this signature in database
GPG Key ID: DA5D6DCBB758A461

View File

@ -5,6 +5,7 @@ import (
"io/ioutil"
"net/http"
"os"
"time"
"github.com/creasty/defaults"
"github.com/gin-gonic/gin"
@ -71,11 +72,14 @@ func updateLicense(licenseKey string) {
panic(err)
}
connector.PostLicense(config.Config.License)
go func() {
connector.PostLicense(config.Config.License)
log.Info().Msg("Updated the license. Exiting.")
log.Info().Msg("Updated the license. Exiting.")
os.Exit(0)
time.Sleep(2 * time.Second)
os.Exit(0)
}()
}
func runLicenseRecieverServer() {