⚡ Add a cache layer in auth to speed up auth
This commit is contained in:
@ -36,11 +36,14 @@ func main() {
|
||||
}
|
||||
|
||||
// Connect to database
|
||||
if err := database.NewSource(); err != nil {
|
||||
if err := database.NewGorm(); err != nil {
|
||||
log.Fatal().Err(err).Msg("An error occurred when connect to database.")
|
||||
} else if err := database.RunMigration(database.C); err != nil {
|
||||
log.Fatal().Err(err).Msg("An error occurred when running database auto migration.")
|
||||
}
|
||||
if err := database.NewBolt(); err != nil {
|
||||
log.Fatal().Err(err).Msg("An error occurred when init bolt db.")
|
||||
}
|
||||
|
||||
// External
|
||||
// All the things are optional so when error occurred the server won't crash
|
||||
@ -83,4 +86,6 @@ func main() {
|
||||
log.Info().Msgf("Identity v%s is quitting...", identity.AppVersion)
|
||||
|
||||
quartz.Stop()
|
||||
|
||||
database.B.Close()
|
||||
}
|
||||
|
Reference in New Issue
Block a user