@memberjunction/server 2.36.1 → 2.37.0

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.
@@ -39,22 +39,21 @@ export class LearningCycleScheduler extends BaseSingleton<LearningCycleScheduler
39
39
  /**
40
40
  * Start the scheduler with the specified interval in minutes
41
41
  * @param intervalMinutes The interval in minutes between runs
42
+ * @param skipLearningAPIurl The URL for the learning cycle API endpoint
42
43
  */
43
44
  public start(intervalMinutes: number = 60): void {
44
-
45
- // start learning cycle immediately upon the server start
46
- this.runLearningCycle()
47
- .catch(error => LogError(`Error in initial learning cycle: ${error}`));
48
-
49
- const intervalMs = intervalMinutes * 60 * 1000;
50
-
51
45
  LogStatus(`Starting learning cycle scheduler with interval of ${intervalMinutes} minutes`);
52
46
 
53
- // Schedule the recurring task
47
+ // Set up the interval for recurring calls
48
+ const intervalMs = intervalMinutes * 60 * 1000;
54
49
  this.intervalId = setInterval(() => {
55
50
  this.runLearningCycle()
56
51
  .catch(error => LogError(`Error in scheduled learning cycle: ${error}`));
57
52
  }, intervalMs);
53
+
54
+ // Start learning cycle immediately upon the server start
55
+ this.runLearningCycle()
56
+ .catch(error => LogError(`Error in initial learning cycle: ${error}`));
58
57
  }
59
58
 
60
59
  /**
@@ -76,8 +75,6 @@ export class LearningCycleScheduler extends BaseSingleton<LearningCycleScheduler
76
75
  const startTime = new Date();
77
76
 
78
77
  try {
79
- LogStatus('Starting scheduled learning cycle execution');
80
-
81
78
  // Make sure we have data sources
82
79
  if (!this.dataSources || this.dataSources.length === 0) {
83
80
  throw new Error('No data sources available for the learning cycle');