@punks/backend-entity-manager 0.0.283 → 0.0.285

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/cjs/index.js CHANGED
@@ -33784,10 +33784,11 @@ JobsMonitorTask = JobsMonitorTask_1 = __decorate([
33784
33784
  __metadata("design:paramtypes", [Object, Object, cqrs.CommandBus])
33785
33785
  ], JobsMonitorTask);
33786
33786
 
33787
+ const jobsSettings = new AppInMemorySettings();
33788
+
33787
33789
  var JobsScheduler_1;
33788
33790
  let JobsScheduler = JobsScheduler_1 = class JobsScheduler {
33789
- constructor(jobsSettings, schedulerRegistry, schedulerTask, monitorTask) {
33790
- this.jobsSettings = jobsSettings;
33791
+ constructor(schedulerRegistry, schedulerTask, monitorTask) {
33791
33792
  this.schedulerRegistry = schedulerRegistry;
33792
33793
  this.schedulerTask = schedulerTask;
33793
33794
  this.monitorTask = monitorTask;
@@ -33823,11 +33824,13 @@ let JobsScheduler = JobsScheduler_1 = class JobsScheduler {
33823
33824
  this.registerJobsScheduler();
33824
33825
  this.registerJobsMonitor();
33825
33826
  }
33827
+ get jobsSettings() {
33828
+ return jobsSettings.value;
33829
+ }
33826
33830
  };
33827
33831
  JobsScheduler = JobsScheduler_1 = __decorate([
33828
33832
  common.Injectable(),
33829
- __param(0, common.Inject(getEntityManagerProviderToken("JobsModuleSettings"))),
33830
- __metadata("design:paramtypes", [Object, schedule.SchedulerRegistry,
33833
+ __metadata("design:paramtypes", [schedule.SchedulerRegistry,
33831
33834
  JobsSchedulerTask,
33832
33835
  JobsMonitorTask])
33833
33836
  ], JobsScheduler);
@@ -33976,10 +33979,11 @@ let JobDispatchHandler = JobDispatchHandler_1 = class JobDispatchHandler {
33976
33979
  instanceId,
33977
33980
  payload,
33978
33981
  });
33979
- await this.instances.updateInstance(instanceId, {
33982
+ const instance = await this.instances.updateInstance(instanceId, {
33980
33983
  status: exports.JobStatus.Ready,
33981
33984
  });
33982
33985
  this.logger.info(`JOB DISPATCH -> dispatching completed job ${job.uid} -> ${instanceId}`);
33986
+ return instance;
33983
33987
  }
33984
33988
  catch (e) {
33985
33989
  await this.instances.updateInstance(instanceId, {
@@ -34130,16 +34134,10 @@ exports.JobsModule = JobsModule_1 = class JobsModule {
34130
34134
  await this.jobsProviderFactory.initialize();
34131
34135
  }
34132
34136
  static forRoot(input) {
34137
+ jobsSettings.initialize(input);
34133
34138
  return {
34134
34139
  module: JobsModule_1,
34135
34140
  ...ModuleData$7,
34136
- providers: [
34137
- ...ModuleData$7.providers,
34138
- {
34139
- provide: getEntityManagerProviderToken("JobsModuleSettings"),
34140
- useValue: input,
34141
- },
34142
- ],
34143
34141
  };
34144
34142
  }
34145
34143
  };