Пример #1
0
    def on_success(self, retval, task_id, args, kwargs):
        if settings.METRICS_ENABLED:
            pretix_task_runs_total.inc(1,
                                       task_name=self.name,
                                       status="success")

        return super().on_success(retval, task_id, args, kwargs)
Пример #2
0
    def on_failure(self, exc, task_id, args, kwargs, einfo):
        if settings.METRICS_ENABLED:
            expected = False
            for t in self.throws:
                if isinstance(exc, t):
                    expected = True
                    break
            pretix_task_runs_total.inc(1, task_name=self.name, status="expected-error" if expected else "error")

        return super().on_failure(exc, task_id, args, kwargs, einfo)
Пример #3
0
    def on_failure(self, exc, task_id, args, kwargs, einfo):
        if settings.METRICS_ENABLED:
            expected = False
            for t in self.throws:
                if isinstance(exc, t):
                    expected = True
                    break
            pretix_task_runs_total.inc(
                1,
                task_name=self.name,
                status="expected-error" if expected else "error")

        return super().on_failure(exc, task_id, args, kwargs, einfo)
Пример #4
0
    def on_success(self, retval, task_id, args, kwargs):
        if settings.METRICS_ENABLED:
            pretix_task_runs_total.inc(1, task_name=self.name, status="success")

        return super().on_success(retval, task_id, args, kwargs)