upstash / qstash-js

Message queue for serverless
https://docs.upstash.com/qstash
MIT License
158 stars 15 forks source link

Why is notBefore and delay in seconds and not milliseconds? #42

Closed kristianeboe closed 1 year ago

kristianeboe commented 1 year ago

I kept getting errors when using the SDK that I was trying to delay a message more than a year, when i finally found in your SDK docs that you expect delay and notBefore in seconds. image

Most JS dates and durations operate with milliseconds, wouldn't that be a simpler standard for you too?

I'm trying to do this now 🤞 image

chronark commented 1 year ago

Yeah, fair point it was mostly because I thought delaying <1s wouldn't be accurate anyways.

JS does handle everything in milliseconds, but that's not necessarily true for all other languages, so there isn't a clear path forward.