Add cronRuns table and integrate job scheduling with database logging

- Created a new `cronRuns` table to track job execution history, including job name, status, timestamps, and error messages.
- Updated job scheduling logic to log job status in the `cronRuns` table, capturing success and error states.
- Enhanced error handling to log detailed error messages in the database.

This commit establishes a foundation for monitoring scheduled jobs and their outcomes.
This commit is contained in:
2026-03-04 12:59:19 -05:00
parent 83456c6a21
commit b17f54f6db
4 changed files with 2119 additions and 23 deletions
@@ -0,0 +1,10 @@
CREATE TABLE `cronRuns` (
`id` text PRIMARY KEY,
`jobName` text NOT NULL,
`status` text NOT NULL,
`startedAt` integer NOT NULL,
`finishedAt` integer,
`errorMessage` text
);
--> statement-breakpoint
CREATE INDEX `cronRuns_jobName_startedAt` ON `cronRuns` (`jobName`,`startedAt`);
File diff suppressed because it is too large Load Diff