We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d69680 commit be4c026Copy full SHA for be4c026
src/Job.ts
@@ -170,6 +170,8 @@ export class Job<DATA = any | void> {
170
}
171
172
async save(): Promise<Job> {
173
+ // ensure db connection is ready
174
+ await this.agenda.ready;
175
return this.agenda.db.saveJob(this);
176
177
src/index.ts
@@ -63,7 +63,7 @@ export class Agenda extends EventEmitter {
63
64
private jobProcessor?: JobProcessor;
65
66
- private ready: Promise<void>;
+ readonly ready: Promise<void>;
67
68
async getRunningStats(fullDetails = false): Promise<IAgendaStatus> {
69
if (!this.jobProcessor) {
0 commit comments