Skip to content

Commit

Permalink
fix singleton key
Browse files Browse the repository at this point in the history
  • Loading branch information
levinmr committed Feb 26, 2025
1 parent 29b007c commit d70a1a5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/queue/report_job_queue_message.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,18 @@ class ReportJobQueueMessage extends QueueMessage {
retryLimit: 2,
retryDelay: 10,
retryBackoff: true,
singletonKey: `${this.#scriptName}-${this.#agencyName}-${this.#reportConfig.name}`,
singletonKey: this.#singletonKey(),
};
}

#singletonKey() {
if (this.#reportConfig.dateRanges) {
return `${this.#scriptName}-${this.#agencyName}-${this.#reportConfig.name}-${this.#reportConfig.dateRanges[0]}`;
} else {
return `${this.#scriptName}-${this.#agencyName}-${this.#reportConfig.name}`;
}
}

#messagePriority(reportFrequency) {
let priority;
switch (reportFrequency) {
Expand Down

0 comments on commit d70a1a5

Please sign in to comment.