question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Offset syntax works incorrectly

See original GitHub issue

*/10 * * * * should be run at min 0th, 10th, 20th, 30th… 2-59/10 * * * * should be run at 2nd, 12nd, 22nd, 32nd…

Currently, the 2 syntaxes above return the same result.

Should I need to put in any option to run correctly?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
wiggissercommented, Oct 4, 2022

Actually, this is also wrong for days. A pattern like 0 0 */2 * * will run on the 2nd, 4th, 6th … day of every month instead of 1st, 3rd, 5th … because for the date the * expands to 1-31, thus */2 should start at 1 and progress in steps of 2

1reaction
wiggissercommented, Oct 4, 2022

@mooosh-milllie That’s exactly what the issue is about:

2-59/10 * * * * should be equivalent to 2,12,22,32,42,52 * * * * but with node-cron it’s (wrongly) expanded to 10,20,30,40,50 * * * *

Because the 10 in 2-59/10 is not a divisor but a stepsize. Ie, the semantics of this expression is: start at minute 2 and progress in steps of 10 whereas node-cron implements the (wrong) logic, take all minutes in the range 2-59 which are divisible by 10 without remainder https://github.com/node-cron/node-cron/blob/a0be3f4a7a5419af109cecf4a41071ea559b9b3d/src/convert-expression/step-values-conversion.js#L19

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incorrect syntax near OFFSET command - sql - Stack Overflow
My problem was that I was attempting to use OFFSET on a view, but wasn't joining.
Read more >
Incorrect syntax near 'OFFSET'. - MSDN - Microsoft
hi all,. below is my query but, im getting error as "Incorrect syntax near 'OFFSET'. Incorrect syntax near '@P_Take'. " declare @ ...
Read more >
SqlException: Incorrect syntax near 'OFFSET'. | Lendy's blog
Invalid usage of the option NEXT in the FETCH statement. Incorrect syntax near 'OFFSET'. The issue is caused by the fact that SQL...
Read more >
OFFSET is bad for skipping previous rows - Use The Index, Luke
OFFSET doesn't deliver stable results and makes the query slow. Key-set pagination does neither.
Read more >
Excel OFFSET function Explained in Simple Steps - XelPlus
To do that, you highlight the cells under the Sales column. However, the problem is that with a dynamic report such as this,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found