Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Nov 19, 2024
1 parent 42e17a8 commit bb5f063
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scheduler/admin/task_admin.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import redis
import valkey
from django.contrib import admin, messages
from django.contrib.contenttypes.admin import GenericStackedInline
from django.utils.translation import gettext_lazy as _

from scheduler import tools
from scheduler.broker_types import ConnectionErrorTypes
from scheduler.models import TaskArg, TaskKwarg, Task
from scheduler.settings import SCHEDULER_CONFIG, logger
from scheduler.tools import get_job_executions_for_task, TaskType
Expand Down Expand Up @@ -123,7 +122,7 @@ def change_view(self, request, object_id, form_url="", extra_context=None):
obj = self.get_object(request, object_id)
try:
execution_list = get_job_executions_for_task(obj.queue, obj)
except (redis.ConnectionError, valkey.ConnectionError) as e:
except ConnectionErrorTypes as e:
logger.warn(f"Could not get job executions: {e}")
execution_list = list()
paginator = self.get_paginator(request, execution_list, SCHEDULER_CONFIG.EXECUTIONS_IN_PAGE)
Expand Down

0 comments on commit bb5f063

Please sign in to comment.