summaryrefslogtreecommitdiffstats
path: root/modules/queue/manager.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/queue/manager.go')
-rw-r--r--modules/queue/manager.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/queue/manager.go b/modules/queue/manager.go
index a88933191a..23e96155a9 100644
--- a/modules/queue/manager.go
+++ b/modules/queue/manager.go
@@ -9,6 +9,7 @@ import (
"fmt"
"reflect"
"sort"
+ "strings"
"sync"
"time"
@@ -169,7 +170,17 @@ func (m *Manager) FlushAll(baseCtx context.Context, timeout time.Duration) error
for {
select {
case <-ctx.Done():
- return ctx.Err()
+ mqs := m.ManagedQueues()
+ nonEmptyQueues := []string{}
+ for _, mq := range mqs {
+ if !mq.IsEmpty() {
+ nonEmptyQueues = append(nonEmptyQueues, mq.Name)
+ }
+ }
+ if len(nonEmptyQueues) > 0 {
+ return fmt.Errorf("flush timeout with non-empty queues: %s", strings.Join(nonEmptyQueues, ", "))
+ }
+ return nil
default:
}
mqs := m.ManagedQueues()