INNER CODE UNIT · Go
run
LerianStudio/midaz · components/tracer/cmd/migrate-cel-rules/main.go:88
func run(up, down bool) error {
pkg.InitLocalEnvConfig()
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
migration, err := bootstrap.InitCELRuleMigration(ctx)
if err != nil {
return fmt.Errorf("failed to initialize migration: %w", err)
}
defer func() {
if closeErr := migration.Close(ctx); closeErr != nil {
migration.Logger.Log(ctx, libLog.LevelError, "Failed to close migration resources", libLog.Err(closeErr))
}
}()
// --down is explicit intent to fail loud; it takes precedence over the