@lage-run/scheduler 0.5.3 → 0.5.4

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/CHANGELOG.json CHANGED
@@ -2,7 +2,22 @@
2
2
  "name": "@lage-run/scheduler",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 31 Oct 2022 21:27:32 GMT",
5
+ "date": "Mon, 31 Oct 2022 21:56:01 GMT",
6
+ "tag": "@lage-run/scheduler_v0.5.4",
7
+ "version": "0.5.4",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "kchau@microsoft.com",
12
+ "package": "@lage-run/scheduler",
13
+ "commit": "6d1d50bdb9245688edd0d7b6061bed2b1cdc3fd1",
14
+ "comment": "adds taskArgs param for worker scripts"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Mon, 31 Oct 2022 21:27:52 GMT",
6
21
  "tag": "@lage-run/scheduler_v0.5.3",
7
22
  "version": "0.5.3",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # Change Log - @lage-run/scheduler
2
2
 
3
- This log was last generated on Mon, 31 Oct 2022 21:27:32 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 31 Oct 2022 21:56:01 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.5.4
8
+
9
+ Mon, 31 Oct 2022 21:56:01 GMT
10
+
11
+ ### Patches
12
+
13
+ - adds taskArgs param for worker scripts (kchau@microsoft.com)
14
+
7
15
  ## 0.5.3
8
16
 
9
- Mon, 31 Oct 2022 21:27:32 GMT
17
+ Mon, 31 Oct 2022 21:27:52 GMT
10
18
 
11
19
  ### Patches
12
20
 
@@ -1,4 +1,7 @@
1
1
  import type { TargetRunner, TargetRunnerOptions } from "@lage-run/scheduler-types";
2
+ export interface WorkerRunnerOptions {
3
+ taskArgs: string[];
4
+ }
2
5
  /**
3
6
  * Creates a workerpool per target task definition of "type: worker"
4
7
  *
@@ -35,6 +38,8 @@ import type { TargetRunner, TargetRunnerOptions } from "@lage-run/scheduler-type
35
38
  * ```
36
39
  */
37
40
  export declare class WorkerRunner implements TargetRunner {
41
+ private options;
38
42
  static gracefulKillTimeout: number;
43
+ constructor(options: WorkerRunnerOptions);
39
44
  run(runOptions: TargetRunnerOptions): Promise<void>;
40
45
  }
@@ -37,9 +37,13 @@ exports.WorkerRunner = void 0;
37
37
  * ```
38
38
  */
39
39
  class WorkerRunner {
40
+ constructor(options) {
41
+ this.options = options;
42
+ }
40
43
  async run(runOptions) {
41
44
  var _a, _b, _c;
42
45
  const { target, weight, abortSignal } = runOptions;
46
+ const { taskArgs } = this.options;
43
47
  const scriptFile = (_b = (_a = target.options) === null || _a === void 0 ? void 0 : _a.worker) !== null && _b !== void 0 ? _b : (_c = target.options) === null || _c === void 0 ? void 0 : _c.script;
44
48
  if (!scriptFile) {
45
49
  throw new Error('WorkerRunner: "script" configuration is required - e.g. { type: "worker", script: "./worker.js" }');
@@ -50,7 +54,7 @@ class WorkerRunner {
50
54
  if (typeof runFn !== "function") {
51
55
  throw new Error("WorkerRunner: worker script must export a function; you likely need to use `module.exports = function() {...}`");
52
56
  }
53
- await runFn({ target, weight, abortSignal });
57
+ await runFn({ target, weight, taskArgs, abortSignal });
54
58
  }
55
59
  }
56
60
  exports.WorkerRunner = WorkerRunner;
@@ -1 +1 @@
1
- {"version":3,"file":"WorkerRunner.js","sourceRoot":"","sources":["../../src/runners/WorkerRunner.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAa,YAAY;IAGvB,KAAK,CAAC,GAAG,CAAC,UAA+B;;QACvC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC;QACnD,MAAM,UAAU,GAAG,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,MAAM,mCAAI,MAAA,MAAM,CAAC,OA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AAG,OAAO,YAAY,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;QAE/F,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,gHAAgH,CAAC,CAAC;SACnI;QAED,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;IACzD,CAAC;;AAvBH,oCAwBC;AAvBQ,gCAAmB,GAAG,IAAI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lage-run/scheduler",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Scheduler for Lage",
5
5
  "repository": {
6
6
  "url": "https://github.com/microsoft/lage"