@push.rocks/taskbuffer 3.0.12 → 3.0.15

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.
@@ -21,8 +21,8 @@ export class TaskManager {
21
21
  distributedCoordinator: null,
22
22
  };
23
23
 
24
- constructor(optionosArg: ITaskManagerConstructorOptions = {}) {
25
- this.options = Object.assign(this.options, optionosArg);
24
+ constructor(optionsArg: ITaskManagerConstructorOptions = {}) {
25
+ this.options = Object.assign(this.options, optionsArg);
26
26
  }
27
27
 
28
28
  /**
@@ -137,11 +137,19 @@ export class TaskManager {
137
137
  public async descheduleTask(task: Task) {
138
138
  await this.descheduleTaskByName(task.name);
139
139
  }
140
+
140
141
  /**
141
- * returns all schedules of a specific task
142
- * @param taskNameArg
143
- */
144
- public getSchedulesForTaskName(taskNameArg: string) {}
142
+ * returns the schedule of a specific task
143
+ * @param taskNameArg
144
+ */
145
+ public getScheduleForTaskName(taskNameArg: string): string | null {
146
+ const task = this.getTaskByName(taskNameArg);
147
+ if (!task || !task.cronJob) {
148
+ return null;
149
+ }
150
+ return task.cronJob.cronExpression;
151
+ }
152
+
145
153
 
146
154
  /**
147
155
  * starts the taskmanager