Skip to content

Commit a74c44b

Browse files
committed
refactor(runner): add active worker names to HawkCatcher context
1 parent 46585f7 commit a74c44b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

runner.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import * as dotenv from 'dotenv';
1212

1313
dotenv.config();
1414

15-
if (process.env.HAWK_CATCHER_TOKEN) {
16-
HawkCatcher.init(process.env.HAWK_CATCHER_TOKEN);
17-
}
18-
1915
type WorkerConstructor = new () => Worker;
2016

2117
const BEGINNING_OF_ARGS = 2;
@@ -27,6 +23,18 @@ const BEGINNING_OF_ARGS = 2;
2723
*/
2824
const workerNames = process.argv.slice(BEGINNING_OF_ARGS);
2925

26+
/**
27+
* Initialize HawkCatcher
28+
*/
29+
if (process.env.HAWK_CATCHER_TOKEN) {
30+
HawkCatcher.init({
31+
token: process.env.HAWK_CATCHER_TOKEN,
32+
context: {
33+
workerTypes: workerNames.join(","),
34+
}
35+
});
36+
}
37+
3038
/**
3139
* Workers dispatcher.
3240
* Load, run and finish workers.

0 commit comments

Comments
 (0)