Use durable log spool in worker entrypoint
This commit is contained in:
+8
-3
@@ -73,13 +73,18 @@ func main() {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
log.Printf("RUN phase=artifact_queue status=ready path=%s", diagnosticValue(cfg.SpoolRoot))
|
log.Printf("RUN phase=artifact_queue status=ready path=%s", diagnosticValue(cfg.SpoolRoot))
|
||||||
liveLogSink := runruntime.NewLiveLogSink(client)
|
log.Printf("RUN phase=log_spool status=opening path=%s", diagnosticValue(cfg.SpoolRoot))
|
||||||
defer liveLogSink.Close()
|
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))
|
log.Printf("RUN phase=worker_init status=starting endpoint=%s", diagnosticValue(cfg.RunEndpointID))
|
||||||
worker, err := runruntime.NewWorker(
|
worker, err := runruntime.NewWorker(
|
||||||
cfg,
|
cfg,
|
||||||
client,
|
client,
|
||||||
runruntime.WithProcessLogSink(liveLogSink),
|
runruntime.WithProcessLogSink(&runruntime.SpoolLogSink{Spool: logSpool}),
|
||||||
runruntime.WithLifecycleArtifactHook(&runruntime.QueueArtifactHook{Queue: artifactQueue}),
|
runruntime.WithLifecycleArtifactHook(&runruntime.QueueArtifactHook{Queue: artifactQueue}),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user