Skip to content

Problem executing a background task using typescript ? #484

Description

@andreidiaconescu

Hello,

i have a server written in typescript, which is based on express.
I need to run a background task, also written in typescript, so that the main server can still accept http requests while the cron task is running.
But i got stuck:

    cron.schedule('*/2 * * * *', '/app/src/crons/import-outbe-and-report.ts')

produces error in terminal:

UnhandledRejection: Error: Start operation timed out
 at Timeout._onTimeout (/app/node_modules/node-cron/src/tasks/background-scheduled-task/background-scheduled-task.ts:63:16)
 at listOnTimeout (node:internal/timers:588:17)
 at processTimers (node:internal/timers:523:7) (process.ts:13)

thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions