feat: add auto update

This commit is contained in:
2026-05-19 15:53:30 +02:00
parent bd3121d688
commit ba4de62a34
22 changed files with 3323 additions and 110 deletions

View File

@ -18,6 +18,7 @@ import (
"github.com/containarr/server/internal/broker"
grpcgateway "github.com/containarr/server/internal/grpc"
agentv1 "github.com/containarr/server/internal/proto/agentv1"
"github.com/containarr/server/internal/scheduler"
"github.com/containarr/server/internal/store"
"google.golang.org/grpc"
)
@ -39,6 +40,14 @@ func main() {
reg := grpcgateway.NewRegistry()
brk := broker.New()
// Root context cancelled on shutdown signal.
rootCtx, rootCancel := context.WithCancel(context.Background())
defer rootCancel()
// Scheduler.
sched := scheduler.New(scheduler.NewStoreAdapter(db), reg)
go sched.Start(rootCtx)
// gRPC server.
gw := grpcgateway.NewGateway(db, reg, brk)
grpcServer := grpc.NewServer()
@ -76,6 +85,7 @@ func main() {
<-quit
slog.Info("shutting down")
rootCancel()
grpcServer.GracefulStop()
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()