@clairejs/server 3.22.6 → 3.22.7
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.
- package/README.md +2 -1
- package/dist/job/AbstractJobScheduler.js +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,8 +44,11 @@ export class AbstractJobScheduler {
|
|
|
44
44
|
const tx = await this.db.createTransaction();
|
|
45
45
|
try {
|
|
46
46
|
const newJob = await jobHandler.handlerFn({ ...job }, tx);
|
|
47
|
+
console.log("after handler new job?", newJob);
|
|
48
|
+
console.log("check job at", job, job.at);
|
|
47
49
|
if (job.at) {
|
|
48
50
|
if (!newJob) {
|
|
51
|
+
console.log("remove job", job.id);
|
|
49
52
|
await this.removeJob(job.id);
|
|
50
53
|
this.logger.info(`Remove one-time job ${job.jobName} at timestamp ${job.at}`);
|
|
51
54
|
}
|
|
@@ -53,9 +56,12 @@ export class AbstractJobScheduler {
|
|
|
53
56
|
await this.afterJob(newJob, tx);
|
|
54
57
|
}
|
|
55
58
|
}
|
|
59
|
+
this.logger.debug("Job tx commiting");
|
|
56
60
|
await tx.commit();
|
|
61
|
+
this.logger.debug("Job tx committed");
|
|
57
62
|
}
|
|
58
63
|
catch (err) {
|
|
64
|
+
this.logger.error("Error handling job", err);
|
|
59
65
|
await tx.rollback();
|
|
60
66
|
}
|
|
61
67
|
return;
|