SQS: sendMessageToQueue лимиты+sync persist, Reset чистит FIFO, nil-map Duplicates, ApproximateReceiveCount без +1, billing.Close после Shutdown, запрет ':' в access_key, recover в PeriodicTasks
This commit is contained in:
+12
-3
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user