feat: simplify SOP to immediate-effect configuration

This commit is contained in:
Eric 1549169735@qq.com
2026-08-18 16:27:02 +08:00
parent c5ab886b70
commit 8de48fb05e
150 changed files with 6764 additions and 1626 deletions

View File

@@ -0,0 +1,39 @@
package main
import (
"flag"
"fmt"
"os"
"git.iwork-ai.com/xdc/iqudo-top1/internal/config"
"git.iwork-ai.com/xdc/iqudo-top1/internal/database"
"git.iwork-ai.com/xdc/iqudo-top1/internal/logger"
"git.iwork-ai.com/xdc/iqudo-top1/internal/multitable"
)
func main() {
configDir := flag.String("config-dir", "configs", "configuration directory")
flag.Parse()
cfg, err := config.Load(config.LoadOptions{ConfigDir: *configDir})
if err != nil {
fmt.Fprintf(os.Stderr, "load configuration: %v\n", err)
os.Exit(1)
}
log, err := logger.New(cfg.App.Env, cfg.App.Name)
if err != nil {
fmt.Fprintf(os.Stderr, "create logger: %v\n", err)
os.Exit(1)
}
defer log.Sync()
db, err := database.Open(cfg.Database, log)
if err != nil {
fmt.Fprintf(os.Stderr, "connect database: %v\n", err)
os.Exit(1)
}
count, err := multitable.EnqueueBackfill(db)
if err != nil {
fmt.Fprintf(os.Stderr, "enqueue backfill: %v\n", err)
os.Exit(1)
}
fmt.Printf("queued %d multitable projection events\n", count)
}