Skip to content

Migrate remaining scheduled jobs to centralized scheduler #716

@bokelley

Description

@bokelley

Background

PR #714 introduced a centralized JobScheduler class in server/src/addie/jobs/scheduler.ts to manage scheduled background jobs. Currently it handles:

  • Document indexer (hourly)
  • Summary generator (daily)

Remaining Jobs to Migrate

The following jobs are still defined inline in server/src/http.ts and should be migrated to the scheduler:

  1. Content curator - Curates and processes content
  2. Feed fetcher - Fetches RSS/Atom feeds
  3. Alert processor - Processes scheduled alerts
  4. Task reminder - Sends task reminders
  5. Engagement scoring - Updates engagement scores
  6. Goal follow-up - Follows up on goals

Benefits of Migration

  • Centralized job management in one place
  • Easier to add new jobs following established pattern
  • Consistent logging with job-scheduler module tag
  • Cleaner http.ts file
  • Foundation for future job management features (pause/resume, admin visibility)

Implementation Notes

Each job should follow the existing pattern:

  • Initial delay on startup (staggered to avoid thundering herd)
  • Periodic interval
  • Proper error handling with logging
  • Start/stop methods on the scheduler class

Acceptance Criteria

  • All scheduled jobs moved to scheduler.ts
  • Jobs removed from http.ts
  • Existing tests pass
  • Job timing/intervals unchanged

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions