Skip to content

Scheduler tick errors cause unhandled promise rejections #6

@panoptican

Description

@panoptican

Type: Bug Report

Description:
The scheduler's setInterval callback calls the async tick() function but does not catch any errors, leading to unhandled promise rejections that may crash the app or cause undefined behavior.

Current Code:

captureInterval = setInterval(() => {
  tick(); // No error handling!
}, intervalMs);

Expected Behavior:
Errors in the scheduler tick should be logged but not crash the scheduler.

Proposed Fix:

captureInterval = setInterval(() => {
  tick().catch((error) => {
    logger.error("Scheduler tick failed:", error);
  });
}, intervalMs);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions