Skip to content

The scheduler is not working correctly #1996

@slavakaderkin

Description

@slavakaderkin

Impress and Node.js versions

Impress: 3.0.18 Node: 20-alpine

Platform

Linux Fedora 41

Describe the bug

If I schedule a recurring task in metarhia/Example like this:

async () => {
  if (!config.examples.scheduler) return;
  if (application.worker.id !== 'W1') return;
  const res = await application.scheduler.add({
    name: 'name',
    every: '5s',
    args: { i: 2 },
    run: 'lib.task1.f1',
  });
  console.log('Add task', res);
};

It only runs once.

Single tasks are not removed from /tasks after execution
There were also issues with executing delayed tasks scheduled for a date one or several days in the future.

To Reproduce

No response

Expected behavior

No response

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions