Closed anrw closed 2 years ago
Hi @anrw - I think our business want something similar. I've already got a fork of Django Cron which adds some other features and I'll probably make something for this soon if you're interested?
Thanks, @evenicoulddoit! I am definitely interested, how can I find it?
@anrw we generally felt log management should be left to the dev. However, ...
@evenicoulddoit We could be interested in implementing something that is default off, but when turned on and running crons it would check for some amount of successful or overall logs defined by the user then delete. Let me know if this is something you'd be interested in contributing to. Otherwise it will go to our wishlist for now.
something like we do with this time based deletion
def clear_old_log_entries(): """ Removes older log entries, if the appropriate setting has been set """ if hasattr(settings, 'DJANGO_CRON_DELETE_LOGS_OLDER_THAN'): delta = timedelta(days=settings.DJANGO_CRON_DELETE_LOGS_OLDER_THAN) CronJobLog.objects.filter(end_time__lt=get_current_time() - delta).delete()`
I've shared a solution that can help with this issue in #144
Hey all, Need your advice on best practice :)
I am running cron job every minute to check if there is anything I need users to notify. If so, I send them push notifications. Everything works great, however it logs me 1440 database rows a day, which I think is not great. Is it a way to remove row immediately if cron job has finished with success?
Thank you in advance, Andrew