Конфигурация RateLimits очереди задач Google Cloud игнорируется
Мы создаем очередь Google Cloud Tasks (v2beta3) с установленным параметром ограничения скорости, однако этот параметр ограничения скорости игнорируется и вместо этого использует значения по умолчанию Googles:
cloud_tasks_res = await tasksClient.createQueue({
parent: `projects/PROJECT-ID/locations/LOCATION`,
queue: {
name: `projects/PROJECT-ID/locations/LOCATION/queues/myqueue`,
rateLimits: {
maxTasksDispatchedPerSecond: 100,
maxConcurrentTasks: 50
},
retryConfig: {
maxAttempts: 150,
maxRetryDuration: { seconds: 0, nanos: 0 },
minBackoff: { seconds: 15, nanos: 0 },
maxBackoff: { seconds: 43200, nanos: 0 },
maxDoublings: 13
}
}
});
С участием cloud_tasks_res
возвращения:
[
{
name: `projects/PROJECT-ID/locations/LOCATION/queues/myqueue`,
purgeTime: null,
rateLimits: {
maxBurstSize: 100,
maxConcurrentDispatches: 1000,
maxDispatchesPerSecond: 500
},
retryConfig: {
maxAttempts: 150,
maxBackoff: { nanos: 0, seconds: "43200" },
maxDoublings: 13,
maxRetryDuration: null,
minBackoff: { nanos: 0, seconds: "15" }
},
stackdriverLoggingConfig: null,
state: "RUNNING"
},
undefined,
undefined
]
В соответствии с документацией, как мы это сделали, все выглядит правильно: https://googleapis.dev/nodejs/tasks/latest/v2beta3.CloudTasksClient.html https://googleapis.dev/nodejs/tasks/latest/google.cloud.tasks.v2beta3.html
1 ответ
Решение
Вы не правильно указали поля:
maxTasksDispatchedPerSecond
должно быть maxDispatchesPerSecond
maxConcurrentTasks
должно быть maxConcurrentDispatches