niahere 0.2.49 → 0.2.50

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "niahere",
3
- "version": "0.2.49",
3
+ "version": "0.2.50",
4
4
  "description": "A personal AI assistant daemon — scheduled jobs, chat across Telegram and Slack, persona system, and visual identity.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -79,10 +79,10 @@ async function tick(): Promise<void> {
79
79
 
80
80
  for (const job of dueJobs) {
81
81
  if (!job.always && !isWithinActiveHours()) {
82
- const nextRun = computeNextRun(job.scheduleType, job.schedule, config.timezone, new Date());
83
- if (nextRun) {
84
- await Job.markRun(job.name, nextRun).catch(() => {});
85
- }
82
+ try {
83
+ const nextRun = computeNextRun(job.scheduleType, job.schedule, config.timezone, new Date());
84
+ if (nextRun) await Job.markRun(job.name, nextRun).catch(() => {});
85
+ } catch {}
86
86
  log.info({ job: job.name }, "scheduler: skipping — outside active hours");
87
87
  continue;
88
88
  }
@@ -95,7 +95,14 @@ async function tick(): Promise<void> {
95
95
  log.error({ err, job: job.name }, "scheduler: job failed");
96
96
  });
97
97
 
98
- const nextRun = computeNextRun(job.scheduleType, job.schedule, config.timezone, new Date());
98
+ let nextRun: Date | null = null;
99
+ try {
100
+ nextRun = computeNextRun(job.scheduleType, job.schedule, config.timezone, new Date());
101
+ } catch (err) {
102
+ log.error({ err, job: job.name, schedule: job.schedule }, "scheduler: invalid schedule, disabling job");
103
+ await Job.update(job.name, { enabled: false }).catch(() => {});
104
+ continue;
105
+ }
99
106
  await Job.markRun(job.name, nextRun).catch((err) => {
100
107
  log.error({ err, job: job.name }, "scheduler: failed to update next_run_at");
101
108
  });