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

move parts to SignalInfoManager model #146

Open Skrattoune opened 6 months ago

Skrattoune commented 6 months ago

I implemented some ToDos that you let in the code of task.py:

    signal_kwargs = {
        # TODO: move parts into huey_monitor.models.SignalInfoManager
        'hostname': get_hostname(),
        'pid': os.getpid(),
        'thread': threading.current_thread().name,
        'signal_name': signal,
    }

and

            last_signal = SignalInfoModel.objects.create(
                # TODO: move parts into huey_monitor.models.SignalInfoManager
                hostname=get_hostname(),
                pid=os.getpid(),
                thread=threading.current_thread().name,
                task_id=task_model_instance.pk,
                signal_name='unknown',
                progress_count=task_model_instance.progress_count,
            )

This is needed for the upcoming PR.

Best regards