refactor: update worker processes in EvoBGP to accept dependencies for shared store and job registry. Enhance scheduler, ingest, render, and deploy components to utilize a unified context and improve logging for drift detection. Update architecture documentation to reflect changes in process interactions and worker functionalities.
This commit is contained in:
@@ -5,9 +5,12 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"evobgp/internal/config"
|
||||
"evobgp/internal/httpapi"
|
||||
"evobgp/internal/render"
|
||||
)
|
||||
|
||||
@@ -20,5 +23,20 @@ func main() {
|
||||
log.Printf("%s starting (reference profile worker)", name)
|
||||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
||||
defer stop()
|
||||
render.Run(ctx)
|
||||
|
||||
bctx, bcancel := context.WithTimeout(context.Background(), 90*time.Second)
|
||||
defer bcancel()
|
||||
opts := httpapi.Options{
|
||||
DatabaseURL: strings.TrimSpace(os.Getenv("EVOBGP_DATABASE_URL")),
|
||||
SeedDemo: os.Getenv("EVOBGP_SEED_DEMO") != "0",
|
||||
}
|
||||
st, _, pool, err := httpapi.BootstrapWorkers(bctx, opts)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if pool != nil {
|
||||
defer pool.Close()
|
||||
}
|
||||
|
||||
render.Run(ctx, &render.Deps{Store: st})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user