django-q2 icon indicating copy to clipboard operation
django-q2 copied to clipboard

how to influence an existing schedule

Open vdejager opened this issue 1 year ago • 1 comments

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,
        )

vdejager avatar Feb 21 '25 10:02 vdejager

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.

Grayknife avatar Feb 21 '25 12:02 Grayknife