Publish ITWorx Pulse source
Public source validation / validate (push) Failing after 3m8s

This commit is contained in:
ITWorx Pulse release export
2026-09-03 02:09:19 +02:00
commit bd774932d5
614 changed files with 77116 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
package main
import (
"context"
"log/slog"
"os"
"time"
"github.com/itworx/pulse/internal/database"
)
func main() {
logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()
databaseURL := os.Getenv("PULSE_DATABASE_URL")
if databaseURL == "" {
logger.Error("migration failed", "error", "PULSE_DATABASE_URL is required")
os.Exit(1)
}
pool, err := database.NewPool(ctx, database.Config{URL: databaseURL})
if err == nil {
err = database.Ping(ctx, pool)
}
if err == nil {
err = database.Migrate(ctx, pool)
}
if pool != nil {
pool.Close()
}
if err != nil {
logger.Error("migration failed", "error", err)
os.Exit(1)
}
logger.Info("database migrations complete")
}