@easyrpa/sheduler 1.0.12 → 1.0.13

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/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export type ShedulerConfig = {
16
16
  encriptKey: string;
17
17
  pathJobs: string;
18
18
  pythonPath: string;
19
+ scriptJobPath: string;
19
20
  errorHandler?: (error: any) => void | Promise<void>;
20
21
  workerMessageHandler?: (message: ShedulerMessageType) => void | Promise<void>;
21
22
  onWorkerCreated?: (id: string) => void | Promise<void>;
@@ -27,6 +28,7 @@ export declare class Sheduler implements ISheduler {
27
28
  _sheduler: Bree;
28
29
  _encriptKey: string;
29
30
  _pythonPath: string;
31
+ _scriptJobPath: string;
30
32
  _onWorkerCreated?: (id: string) => void | Promise<void>;
31
33
  _onWorkerDeleted?: (id: string) => void | Promise<void>;
32
34
  handleGetCollections: () => Promise<CollectionType[]>;
@@ -61,7 +63,7 @@ export declare class Job implements IJob {
61
63
  worker?: Partial<WorkerOptions>;
62
64
  _pythonPath: string;
63
65
  _defaultScriptName: string;
64
- constructor(jobOption: JobOptionsType, pathJobs: string, pythonPath: string, defaultScriptName?: string);
66
+ constructor(jobOption: JobOptionsType, pathJobs: string, pythonPath: string, scriptJobPath: string, defaultScriptName?: string);
65
67
  get externalData(): JobType;
66
68
  private init;
67
69
  }
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ class Sheduler {
16
16
  this._logger = config.logger;
17
17
  this._encriptKey = config.encriptKey;
18
18
  this._pythonPath = config.pythonPath;
19
+ this._scriptJobPath = config.scriptJobPath;
19
20
  this._sheduler = new bree_1.default({
20
21
  root: false,
21
22
  jobs: [],
@@ -101,7 +102,7 @@ class Sheduler {
101
102
  if (initialEndDateTime < now)
102
103
  return;
103
104
  }
104
- const job = new Job(jobOptions, this.pathJobs, this._pythonPath);
105
+ const job = new Job(jobOptions, this.pathJobs, this._pythonPath, this._scriptJobPath);
105
106
  await this._sheduler.add(job.externalData);
106
107
  await this._sheduler.start(jobOptions._id);
107
108
  return job.name;
@@ -122,7 +123,7 @@ class Sheduler {
122
123
  }
123
124
  return true;
124
125
  })
125
- .map((jobOptions) => new Job(jobOptions, this.pathJobs, this._pythonPath));
126
+ .map((jobOptions) => new Job(jobOptions, this.pathJobs, this._pythonPath, this._scriptJobPath));
126
127
  if (jobs.length == 0) {
127
128
  return;
128
129
  }
@@ -157,9 +158,9 @@ class Sheduler {
157
158
  }
158
159
  exports.Sheduler = Sheduler;
159
160
  class Job {
160
- constructor(jobOption, pathJobs, pythonPath, defaultScriptName) {
161
+ constructor(jobOption, pathJobs, pythonPath, scriptJobPath, defaultScriptName) {
161
162
  this.name = jobOption._id;
162
- this.path = path_1.default.join(process.cwd(), "assets", "scriptFlow.js");
163
+ this.path = scriptJobPath;
163
164
  this.interval = jobOption.interval || 0;
164
165
  this._pythonPath = pythonPath;
165
166
  this._defaultScriptName = defaultScriptName || 'script.py';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyrpa/sheduler",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Sheduler for easy rpa",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@breejs/ts-worker": "^2.0.0",
28
- "@easyrpa/script-creator": "^1.0.13",
28
+ "@easyrpa/script-creator": "^1.0.14",
29
29
  "bree": "^9.2.9",
30
30
  "crypto-ts": "^1.0.2"
31
31
  },