fix(scheduler): handle setTimeout overflow for long sleep durations
Node.js setTimeout uses a 32-bit signed integer for the delay, so values larger than 2^31-1 ms (~24.8 days) cause the callback to fire immediately. Fix by chunking the wait into segments of at most 2^30 ms. Signed-off-by: Fredrik Adelöw <freben@spotify.com> Made-with: Cursor Signed-off-by: Fredrik Adelöw <freben@spotify.com> Made-with: Cursor Signed-off-by: Fredrik Adelöw <freben@spotify.com> Made-with: Cursor Signed-off-by: Fredrik Adelöw <freben@spotify.com> Made-with: Cursor Signed-off-by: Fredrik Adelöw <freben@spotify.com> Made-with: Cursor Signed-off-by: Fredrik Adelöw <freben@spotify.com> Made-with: Cursor Signed-off-by: Fredrik Adelöw <freben@spotify.com> Made-with: Cursor Signed-off-by: Fredrik Adelöw <freben@spotify.com> Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-defaults': patch
|
||||
---
|
||||
|
||||
Fixed scheduler `sleep` firing immediately for durations longer than ~24.8 days, caused by Node.js `setTimeout` overflowing its 32-bit millisecond limit.
|
||||
Reference in New Issue
Block a user