django-q2
django-q2 copied to clipboard
how to influence an existing schedule
I have a schedule to delete unused images from a system the receives images at a variable rate. I used to have an daily schedule, but what I actually need is to increase the schedule frequency when more images come in (based on available diskspace for example), to once every 8 hours, or even faster.
How can i achieve that for an existing schedule?
name='delete_unuses_images'
schedule('django.core.management.call_command',
name,
name=name,
schedule_type = 'D',
repeats = -1,
)
What hinders you to run it hourly?
To run a schedule every hour, change it to schedule_type="H".
To run a schedule every 8 hours I would recommend using cron schedule_type="C" and cron="0 */8 * * *".
Your django command delete_unsused_images should handle the logic which and how much files should be deleted.