dt-common-device 7.6.12 → 7.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -90,7 +90,7 @@ let WebhookQueueService = (() => {
|
|
|
90
90
|
const job = await queue.getJob(jobId);
|
|
91
91
|
if (job) {
|
|
92
92
|
// Mark job as completed - it will be removed after TTL
|
|
93
|
-
await job.
|
|
93
|
+
await job.complete();
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
@@ -105,7 +105,7 @@ let WebhookQueueService = (() => {
|
|
|
105
105
|
const job = await queue.getJob(jobId);
|
|
106
106
|
if (job) {
|
|
107
107
|
// Mark job as failed - it will be removed after TTL
|
|
108
|
-
await job.
|
|
108
|
+
await job.fail(new Error(error || "Job processing failed"));
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
@@ -136,11 +136,9 @@ let WebhookQueueService = (() => {
|
|
|
136
136
|
this.webhookQueues.set(queueName, queue);
|
|
137
137
|
}
|
|
138
138
|
const queue = this.webhookQueues.get(queueName);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
// Mark job as active (this prevents other consumers from picking it up)
|
|
143
|
-
await job.moveToActive();
|
|
139
|
+
// Use takeNextJob instead of getWaiting + moveToActive
|
|
140
|
+
const job = await queue.takeNextJob();
|
|
141
|
+
if (job) {
|
|
144
142
|
// Extract propertyId and pmsType from queue name
|
|
145
143
|
const parts = queueName.split("_");
|
|
146
144
|
const propertyId = parts[0];
|