Need to trigger action on 4th Saturday of the month

25 views
Skip to first unread message

M Cain

unread,
Jul 25, 2023, 2:14:07 PM7/25/23
to Django users
User application permits registration for upcoming events.  User wants the registration page to be open on 4th Saturday of every month at 9am ET as the events are very popular with limited capacity and made available on first come first serve basis.  

Django application is deployed on Heroku. Heroku scheduler works except it doesn't 'guarantee' running at specific time (but near the requested time). 

Would celery-redis be better for this? 

Any other suggestions? 

Thank you in advance for replying. 

Ross Meredith

unread,
Jul 25, 2023, 3:06:38 PM7/25/23
to django...@googlegroups.com
No need to involve anything asynchronous, if I understand you correctly.  Just check when the request is made whether it's the right time.  If so process the registration, otherwise show the other page to indicate it's the wrong time.

Ross

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c1af9c55-b2dd-4ab2-af1d-ce5dec4c4ca6n%40googlegroups.com.

Chetan Ganji

unread,
Jul 25, 2023, 4:57:33 PM7/25/23
to django...@googlegroups.com
Hi Mr Cain,

This would make more sense to me!
https://django-celery-beat.readthedocs.io/en/latest/

You could create background tasks to create background tasks that run at any specific time ;-) 
AFAIK, this solution is as good as it can get! 

Thanks!

Regards,
Chetan Ganji
+91-900-483-4183


--

Sebastian Jung

unread,
Jul 25, 2023, 5:11:22 PM7/25/23
to django...@googlegroups.com
Very cool solution chetan. I think i should try it. Thank you 

Mike Dewhirst

unread,
Jul 25, 2023, 10:12:43 PM7/25/23
to Django users
I wrote baklabel.py to produce grandfather back-up label fragments such as "mon", "tue" etc and "fri_1", "fri_2" etc as well as month-end and year-end label fragments. It has no dependencies and accepts args so you could change "fri_1" etc to "sat_1".

If you called it at 9am ET every day it would tell you "sat_4" once per month.

There are options to nullify month-end and year-end which you would need to employ to prevent them from spoiling "sat_4" if it fell on a month-end or year-end.

pip install baklabel

https://github.com/mdewhirst/baklabel

Cheers

Mike


Thank you in advance for replying. 
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c1af9c55-b2dd-4ab2-af1d-ce5dec4c4ca6n%40googlegroups.com.


-- 
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.
OpenPGP_signature

M Cain

unread,
Jul 27, 2023, 9:57:26 AM7/27/23
to Django users
thank you. I will try it out. 

M Cain

unread,
Jul 27, 2023, 10:01:23 AM7/27/23
to Django users
thank you Ross. that is an interesting idea. in my USE case, i would need to check if today is sign up Saturday and then display the 'Signup Saturday page', otherwise leave the other pages active.  
Reply all
Reply to author
Forward
0 new messages