boxine / django-huey-monitor

Django based tool for monitoring huey task queue: https://github.com/coleifer/huey
GNU General Public License v3.0
86 stars 20 forks source link

Setting DEFAULT_TASK_CUMULATE_PROGRESS in app settings #145

Open Skrattoune opened 6 months ago

Skrattoune commented 6 months ago

Hi Jedie,

I'm coming back to you about one of the first topics we discussed together a few years back.

For you, it is important to have cumulate_progress = True because of the nature of the tasks you're using. So you decided to set cumulate_progress = True by default when creating a TaskModel object.

for me, it is the contrary, it is important to have cumulate_progress = False because of the nature of the tasks I'm using.

In most application, it will be either one way, or the other, but very rarely both ways in the same application.

What would you say about introducing a constant in the app.settings where we could define DEFAULT_TASK_CUMULATE_PROGRESS to be either True or False

in order to keep retrocompatibility, we could have cumulate_progress = settings.DEFAULT_TASK_CUMULATE_PROGRESS or True if there is no DEFAULT_TASK_CUMULATE_PROGRESS in settings.py

we would also use this as the default value for ProcessInfo.cumulate2parents

Would that be something ok for you ?