From 55d264632f4bd8e325ac1d279b47926d956cac5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 21 Apr 2022 19:01:48 +0200 Subject: [PATCH] Worker: completely flush upstream buffer at startup Completely flush the upstream buffer at startup, before attempting to fetch a new task. These updates could impact any task on the Manager side, and first flushing the buffer before appending new updates also seems like a good idea. --- cmd/flamenco-worker/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/flamenco-worker/main.go b/cmd/flamenco-worker/main.go index ec8cceb2..e7e4eb47 100644 --- a/cmd/flamenco-worker/main.go +++ b/cmd/flamenco-worker/main.go @@ -94,7 +94,8 @@ func main() { timeService := clock.New() buffer = upstreamBufferOrDie(client, timeService) - go buffer.Flush(workerCtx) // Immediately try to flush any updates. + // Flush any updates before actually starting the Worker. + buffer.Flush(workerCtx) cliRunner := worker.NewCLIRunner() listener = worker.NewListener(client, buffer)