diff --git a/buildqueue/worker.go b/buildqueue/worker.go index bba2bdb..85260a7 100644 --- a/buildqueue/worker.go +++ b/buildqueue/worker.go @@ -146,6 +146,19 @@ func processQueue(ctx context.Context) { case <-ctx.Done(): return default: + q := GetQueue() + buildingFound := false + q.ForEach(func(k string, item domain.BuildQueueItem) bool { + if item.Status == domain.Building { + buildingFound = true + return false + } + return true + }) + if buildingFound { + time.Sleep(30 * time.Second) + continue + } err := ProcessNext() if err != nil { slog.Error("unable to process queue: " + err.Error())