package main import ( "context" "os" "os/signal" "git.optclblast.xyz/draincloud/draincloud-core/internal/app" cleanupsessions "git.optclblast.xyz/draincloud/draincloud-core/internal/cron/cleanup_sessions" "git.optclblast.xyz/draincloud/draincloud-core/internal/plugin" "git.optclblast.xyz/draincloud/draincloud-core/internal/storage/postgres" ) func main() { ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill) defer cancel() plugin.MustNewPluginLoader(ctx, 8081, plugin.NewPluginStore()). Run(ctx) pg := postgres.New(ctx, "postgres://draincloud:draincloud@localhost:5432/draincloud?sslmode=disable") cleanupSessionsCron := cleanupsessions.New(pg) cleanupSessionsCron.Run(ctx) go app.New(pg). Run(ctx) <-ctx.Done() }