Skip to content

Commit 1f0b90c

Browse files
authored
feat: run analytics upload immediately on start gf-592 (#592) (#593)
1 parent de6d38a commit 1f0b90c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/analytics/src/libs/modules/task-scheduler/base-task-scheduler.module.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ class BaseTaskScheduler implements TaskScheduler {
1616
}
1717

1818
public start(schedule: string, task: () => void): void {
19-
cron.schedule(schedule, () => {
20-
task();
21-
});
19+
cron.schedule(
20+
schedule,
21+
() => {
22+
task();
23+
},
24+
{ runOnInit: true },
25+
);
2226
this.logger.info(
2327
`Task is scheduled to run according to the pattern: ${schedule}.`,
2428
);

0 commit comments

Comments
 (0)