This commit is contained in:
Untone 2024-03-02 11:56:24 +03:00
parent baeb5a68ea
commit 78930dc8f3
3 changed files with 17 additions and 16 deletions

View File

@ -27,24 +27,25 @@ func main() {
cli.ARG_REDIS_URL = flag.String("redis_url", "", "Redis connection string")
flag.Parse()
// global log level
logrus.SetFormatter(&logs.LogTextFormatter{})
constants.VERSION = VERSION
// initialize required envs (mainly db, env file path and redis)
err := memorystore.InitRequiredEnv()
if err != nil {
logrus.Fatal("Error while initializing required envs: ", err)
}
// initialize logrus
log := logs.InitLog(refs.StringValue(cli.ARG_LOG_LEVEL))
log := logs.InitLog(refs.StringValue(cli.ARG_LOG_LEVEL))
// set logrus formatter
log.SetFormatter(&logs.LogTextFormatter{})
// initialize memory store
err = memorystore.InitMemStore()
if err != nil {
log.Fatal("Error while initializing memory store: ", err)
}
// initialize required envs (mainly db, env file path and redis)
err := memorystore.InitRequiredEnv()
if err != nil {
log.Fatal("Error while initializing required envs: ", err)
}
// initialize required envs (mainly db, env file path and redis)
err := memorystore.InitRequiredEnv()
if err != nil {
log.Fatal("Error while initializing required envs: ", err)
}
// initialize db provider
err = db.InitDB()

View File

@ -321,7 +321,7 @@ func LoginResolver(ctx context.Context, params model.LoginInput) (*model.AuthRes
// Assign the combined data to the provided pointer
user.AppData = &appData
} else {
log.Printf("Error getting author's redis cache: %v", err)
log.Errorf("Error getting author's redis cache: %v", err)
}
res = &model.AuthResponse{

View File

@ -95,7 +95,7 @@ func SessionResolver(ctx context.Context, params *model.SessionQueryInput) (*mod
// Assign the combined data to the provided pointer
user.AppData = &appData
} else {
log.Printf("Error getting author's redis cache: %v", err)
log.Errorf("Error getting author's redis cache: %v", err)
}
res = &model.AuthResponse{