File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -67,17 +67,25 @@ func Boot(ctx context.Context) {
6767
6868func InitAfterDatabase (ctx context.Context ) {
6969 syncs := []func (ctx context.Context ){
70+ InitUser ,
7071 registerPredefinedUser ,
72+ cluster .RegisterPredefinedNodes ,
73+ RegisterAcmeUser ,
74+ }
75+
76+ for _ , v := range syncs {
77+ v (ctx )
78+ }
79+
80+ asyncs := []func (ctx context.Context ){
7181 cert .InitRegister ,
7282 cron .InitCronJobs ,
73- cluster .RegisterPredefinedNodes ,
7483 analytic .RetrieveNodesStatus ,
7584 passkey .Init ,
76- RegisterAcmeUser ,
7785 mcp .Init ,
7886 }
7987
80- for _ , v := range syncs {
88+ for _ , v := range asyncs {
8189 go v (ctx )
8290 }
8391}
Original file line number Diff line number Diff line change 77 "github.com/uozi-tech/cosy"
88)
99
10- func InitUser () {
11- db := cosy .UseDB (context . Background () )
10+ func InitUser (ctx context. Context ) {
11+ db := cosy .UseDB (ctx )
1212 user := & model.User {}
1313 db .Unscoped ().Where ("id = ?" , 1 ).Find (user )
1414
@@ -20,7 +20,7 @@ func InitUser() {
2020 },
2121 Name : "admin" ,
2222 })
23- return
23+ return
2424 }
2525
2626 // if user is found, check if the user is deleted
You can’t perform that action at this time.
0 commit comments