diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -12,6 +12,7 @@ import ( "os/signal" "strconv" "syscall" + "time" "git.anhgelus.world/anhgelus/small-web/backend" "github.com/joho/godotenv" @@ -58,6 +59,15 @@ func main() { os.Exit(1) } + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + db := backend.ConnectDatabase(cfg) + defer db.Close() + err := backend.RunMigration(ctx, db) + if err != nil { + panic(err) + } + for _, sec := range cfg.Sections { if ok = sec.Load(cfg); !ok { slog.Info("exiting") |
