mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
refactor: handling context in goroutines
This commit is contained in:
parent
ecb2ad786b
commit
1a2758ac5b
15 changed files with 161 additions and 140 deletions
|
@ -1,6 +1,7 @@
|
|||
package cluster
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
|
@ -165,7 +166,8 @@ func LoadEnvironmentFromSettings(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
cluster.RegisterPredefinedNodes()
|
||||
ctx := context.Background()
|
||||
cluster.RegisterPredefinedNodes(ctx)
|
||||
|
||||
go analytic.RestartRetrieveNodesStatus()
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ func InstallNginxUI(c *gin.Context) {
|
|||
cSettings.AppSettings.JwtSecret = uuid.New().String()
|
||||
settings.NodeSettings.Secret = uuid.New().String()
|
||||
settings.CertSettings.Email = json.Email
|
||||
if "" != json.Database {
|
||||
if json.Database != "" {
|
||||
settings.DatabaseSettings.Name = json.Database
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ func InstallNginxUI(c *gin.Context) {
|
|||
}
|
||||
|
||||
// Init model
|
||||
kernel.InitDatabase()
|
||||
kernel.PostInstall()
|
||||
|
||||
pwd, _ := bcrypt.GenerateFromPassword([]byte(json.Password), bcrypt.DefaultCost)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue