Skip to content

Commit

Permalink
Resume rate limiting run executions, but reschedule throttled jobs 10…
Browse files Browse the repository at this point in the history
… seconds into the future instead of their original run_at, which will help with database load
  • Loading branch information
ericallam committed May 10, 2024
1 parent 1642fd7 commit 2e02743
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/webapp/app/platform/zodWorker.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ export class ZodWorker<TMessageCatalog extends MessageCatalogSchema> {
this.#logDebug("Rescheduling task", { payload, job: helpers.job });

await this.enqueue(helpers.job.task_identifier, payload, {
runAt: helpers.job.run_at,
runAt: new Date(Date.now() + 1000 * 10),
queueName: await this.#getQueueName(helpers.job.job_queue_id),
priority: helpers.job.priority,
jobKey: helpers.job.key ?? undefined,
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/app/services/worker.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ function getExecutionWorkerQueue() {
},
shutdownTimeoutInMs: env.GRACEFUL_SHUTDOWN_TIMEOUT,
schema: executionWorkerCatalog,
// rateLimiter: executionRateLimiter,
rateLimiter: executionRateLimiter,
tasks: {
performRunExecutionV2: {
priority: 0, // smaller number = higher priority
Expand Down

0 comments on commit 2e02743

Please sign in to comment.