[server][cmd] extract common initialization functions

This commit is contained in:
Abhishek Shroff
2024-10-20 01:16:37 +05:30
parent a869dc5f23
commit e5a34090cf
16 changed files with 138 additions and 156 deletions

View File

@@ -1,7 +1,6 @@
package command
import (
"context"
"os"
"path"
@@ -45,11 +44,6 @@ func SetupCommand() {
os.Mkdir(workDir, 0750)
os.Chdir(workDir)
}
var err error
if err = db.Create(context.Background(), viper.GetString("database_url"), debug && viper.GetBool("trace_sql")); err != nil {
logrus.Fatal(err)
}
}
defer func() {