Skip to content

Commit 5387623

Browse files
fix: return a runner instance from the workerService.run call (#16)
* fix: return a runner instance from the workerService.run call * Fix PR comments --------- Co-authored-by: Alexandre Rousseau <[email protected]>
1 parent e94ce7f commit 5387623

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nestjs-graphile-worker",
3-
"version": "0.4.1",
3+
"version": "0.5.0",
44
"description": "A Nest.js wrapper for Graphile Worker",
55
"author": "Alexandre Rousseau <[email protected]>",
66
"private": false,

src/services/worker.service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
Job,
44
makeWorkerUtils,
55
run,
6+
Runner,
67
RunnerOptions,
78
runOnce,
89
TaskSpec,
@@ -32,13 +33,14 @@ export class WorkerService {
3233
*
3334
* The resolved `Runner` object has a number of helpers on it, see [Runner object](https://github.com/graphile/worker#runner-object) for more information.
3435
*/
35-
async run(): Promise<void> {
36+
async run(): Promise<Runner> {
3637
await this.runMigrations();
3738

3839
this.logger.debug('Start runner');
3940

4041
const runner = await run(this.options);
41-
return runner.promise;
42+
await runner.promise;
43+
return runner;
4244
}
4345

4446
/**

0 commit comments

Comments
 (0)