One at once

This commit is contained in:
ferreo 2024-07-30 00:21:06 +01:00
parent 8827c02861
commit eb79bc4fbc

View File

@ -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())