add 30s timeout to startup context

This commit is contained in:
kiwiidb
2023-09-27 14:38:57 +02:00
parent e1be7e7ea3
commit df6cca2fcb

View File

@@ -71,7 +71,8 @@ func main() {
// Migrate the DB
//Todo: use timeout for startupcontext
startupCtx := context.Background()
startupCtx, startupCancel := context.WithTimeout(context.Background(), 30*time.Second)
defer startupCancel()
migrator := migrate.NewMigrator(dbConn, migrations.Migrations)
err = migrator.Init(startupCtx)
if err != nil {