Unitech / Unitech/pm2

node-schedule not work

Open
#5,447 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

There's a way to run a node schedule automatically with pm2? now i have a file cron.js with this code:

schedule.scheduleJob(
    { hour: 8, minute: 18 },
    async () => {
        console.log('ciao')
    }
)

the server works correclty but the job isn't fired...any suggestion?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue only identifies cron.js and its scheduleJob call; start by checking how cron.js is launched and whether PM2 is managing that process. Reproduce the missing execution using the reported setup, and consider the work complete when the scheduled callback reliably runs under PM2 or the required launch configuration is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.