Is there a way to add expiry date to a Huey Dynamic periodic task ? Just like there is an option in celery task - "some_celery_task.apply_async(args=('foo',), expires=expiry_date)" to add expiry date while creating the task.
I want to add the expiry date while creating the Huey Dynamic periodic task. I used "revoke" , it worked as it supposed to , but I want to stop the task completely after the expiry date not revoking it . When the Huey dynamic periodic task is revoked - message is displayed on the Huey terminal that the huey function is revoked (whenever crontab condition becomes true). (I am using Huey in django)
(Extra) What I did to meet the need of this expiry date - I created the function which return Days - Months pairs for crontab : For eg. start date = 2021-1-20 , end date = 2021-6-14 then the function will return - Days_Month :[['20-31',1], ['*','2-5'], ['1-14','6']] Then I call the Huey Dynamic periodic task (three times in this case). (the Days_Month function will return Day-Months as per requirement - Daily, Weekly, Monthly or repeating after n days)
Is there a better way to do this? Thank you for the help.