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()
|
||||
|
||||
@@ -244,7 +244,7 @@ func buildResultMessage(m *models.SqsMessage) *models.ResultMessage {
|
||||
Attributes: map[string]string{
|
||||
"ApproximateFirstReceiveTimestamp": fmt.Sprintf("%d", m.ReceiptTime.UnixNano()/int64(time.Millisecond)),
|
||||
"SenderId": models.CurrentEnvironment.AccountID,
|
||||
"ApproximateReceiveCount": fmt.Sprintf("%d", m.NumberOfReceives+1),
|
||||
"ApproximateReceiveCount": fmt.Sprintf("%d", m.NumberOfReceives),
|
||||
"SentTimestamp": fmt.Sprintf("%d", m.SentTime.UnixNano()/int64(time.Millisecond)), // Фикс: реальное время отправки
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user