diff --git a/cmd/run/main.go b/cmd/run/main.go index 7a28967..f0a0387 100644 --- a/cmd/run/main.go +++ b/cmd/run/main.go @@ -73,13 +73,18 @@ func main() { os.Exit(1) } log.Printf("RUN phase=artifact_queue status=ready path=%s", diagnosticValue(cfg.SpoolRoot)) - liveLogSink := runruntime.NewLiveLogSink(client) - defer liveLogSink.Close() + log.Printf("RUN phase=log_spool status=opening path=%s", diagnosticValue(cfg.SpoolRoot)) + logSpool, err := spool.NewLogSpool(cfg.SpoolRoot) + if err != nil { + fmt.Fprintf(os.Stderr, "initialize log spool: %v\n", err) + os.Exit(1) + } + log.Printf("RUN phase=log_spool status=ready path=%s", diagnosticValue(cfg.SpoolRoot)) log.Printf("RUN phase=worker_init status=starting endpoint=%s", diagnosticValue(cfg.RunEndpointID)) worker, err := runruntime.NewWorker( cfg, client, - runruntime.WithProcessLogSink(liveLogSink), + runruntime.WithProcessLogSink(&runruntime.SpoolLogSink{Spool: logSpool}), runruntime.WithLifecycleArtifactHook(&runruntime.QueueArtifactHook{Queue: artifactQueue}), ) if err != nil {