SQS: sendMessageToQueue лимиты+sync persist, Reset чистит FIFO, nil-map Duplicates, ApproximateReceiveCount без +1, billing.Close после Shutdown, запрет ':' в access_key, recover в PeriodicTasks

This commit is contained in:
Repinoid
2026-10-11 08:54:21 +03:00
parent e8e0879914
commit 120a44cb6a
6 changed files with 47 additions and 12 deletions
+12 -3
View File
@@ -48,9 +48,18 @@ func PeriodicTasks(d time.Duration, quit chan bool) {
// Каждую очередь обрабатываем под ОТДЕЛЬНЫМ Lock — блокировка одной
// очереди не мешает обработке остальных и HTTP-запросам.
for _, qi := range queues {
qi.queue.LockMu()
processQueueTick(qi.key, qi.queue)
qi.queue.UnlockMu()
func() {
// recover: паника в processQueueTick одной очереди не должна
// убивать весь процесс; mutex освобождается в defer.
defer qi.queue.UnlockMu()
defer func() {
if r := recover(); r != nil {
log.Errorf("gosqs: panic in processQueueTick for queue %q: %v", qi.key, r)
}
}()
qi.queue.LockMu()
processQueueTick(qi.key, qi.queue)
}()
}
case <-quit:
ticker.Stop()