Skip to content

Commit c9da05e

Browse files
committed
WIP
1 parent cd59f19 commit c9da05e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

libs/graphile-worker/src/graphile-worker.service.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import {
33
Job,
44
makeWorkerUtils,
55
run,
6-
runMigrations,
76
RunnerOptions,
87
runOnce,
98
TaskSpec,
9+
WorkerUtils,
1010
} from 'graphile-worker';
1111

1212
@Injectable()
@@ -41,6 +41,10 @@ export class GraphileWorkerService {
4141
await runOnce(this.options);
4242
}
4343

44+
getWorkerUtils(): Promise<WorkerUtils> {
45+
return makeWorkerUtils(this.options);
46+
}
47+
4448
async addJob(
4549
identifier: string,
4650
payload?: unknown,
@@ -53,7 +57,7 @@ export class GraphileWorkerService {
5357
async addJobs(
5458
jobs: Array<{ identifier: string; payload?: unknown; spec?: TaskSpec }>,
5559
): Promise<Job[]> {
56-
const workerUtils = await makeWorkerUtils(this.options);
60+
const workerUtils = await this.getWorkerUtils();
5761
const createdJobs: Job[] = [];
5862

5963
try {
@@ -74,7 +78,6 @@ export class GraphileWorkerService {
7478
return;
7579
}
7680

77-
await runMigrations(this.options);
7881
this.logger.debug('Run migrations');
7982
this.isMigrationDone = true;
8083
}

0 commit comments

Comments
 (0)