modules icon indicating copy to clipboard operation
modules copied to clipboard

feat: add `nuxt-cron`

Open hywax opened this issue 2 years ago • 7 comments

A Nuxt module for cron jobs in app.

hywax avatar Nov 15 '23 09:11 hywax

Thanks for PR i think this is a nice module however the way the crons are initiated in a nitro plugin and never-closing is little bit tricky.

I would suggest to wait on listing this module until Nitro adds native tasks feature. I think it would be best that crons are built on top of tasks for better stability.

pi0 avatar Nov 15 '23 12:11 pi0

@pi0 Thanks for feedback. Yes, cron has never closed before. The new version v1.4.0 adds Nito hook Graceful Shutdown. In which all tasks will be shutdown.

I think that's enough to publish module.

hywax avatar Nov 15 '23 14:11 hywax

I'm not sure if it works with hybrid build / prerendering. So i guess worth to wait specially that release is close :) Will keep you posted.

pi0 avatar Nov 15 '23 15:11 pi0

hybrid build / prerendering - works as it should. I process such builds separately

hywax avatar Nov 15 '23 15:11 hywax

Yep, saw the workaround in your module :)

pi0 avatar Nov 15 '23 15:11 pi0

✅ Graceful Shutdown ✅ Processing hybrid build / prerendering

What else is missing? Maybe I don't understand something 😒

hywax avatar Nov 15 '23 15:11 hywax

I think it should be still built on top of Nitro tasks layer otherwise we will be advising a feature that is inconsistent. Nitro tasks also allows native integration with platform primitives for scheduled tasks which is not possible with module level and i don't want to split ecosystem on this.

I appreciate your effort on making this module but if that you can be patient to see what is coming :)

pi0 avatar Nov 15 '23 15:11 pi0