Skip to content

Commit bb5f063

Browse files
committed
wip
1 parent 42e17a8 commit bb5f063

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scheduler/admin/task_admin.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import redis
2-
import valkey
31
from django.contrib import admin, messages
42
from django.contrib.contenttypes.admin import GenericStackedInline
53
from django.utils.translation import gettext_lazy as _
64

75
from scheduler import tools
6+
from scheduler.broker_types import ConnectionErrorTypes
87
from scheduler.models import TaskArg, TaskKwarg, Task
98
from scheduler.settings import SCHEDULER_CONFIG, logger
109
from scheduler.tools import get_job_executions_for_task, TaskType
@@ -123,7 +122,7 @@ def change_view(self, request, object_id, form_url="", extra_context=None):
123122
obj = self.get_object(request, object_id)
124123
try:
125124
execution_list = get_job_executions_for_task(obj.queue, obj)
126-
except (redis.ConnectionError, valkey.ConnectionError) as e:
125+
except ConnectionErrorTypes as e:
127126
logger.warn(f"Could not get job executions: {e}")
128127
execution_list = list()
129128
paginator = self.get_paginator(request, execution_list, SCHEDULER_CONFIG.EXECUTIONS_IN_PAGE)

0 commit comments

Comments
 (0)