поламалаь с новой логикой, чиним
All checks were successful
Deploy timelaps / deploy (push) Successful in 6s
All checks were successful
Deploy timelaps / deploy (push) Successful in 6s
This commit is contained in:
@@ -59,6 +59,7 @@ def camera_preview(request, camera_id: int):
|
||||
|
||||
|
||||
def job_list(request):
|
||||
"""Отображает таблицу задач и признак активности очереди для автообновления."""
|
||||
qs = TimelapseJob.objects.select_related('camera').all()
|
||||
camera_id = request.GET.get('camera')
|
||||
if camera_id:
|
||||
@@ -78,6 +79,7 @@ def job_list(request):
|
||||
|
||||
|
||||
def worker_logs(request):
|
||||
"""Показывает последние строки лога воркера в интерфейсе."""
|
||||
logger.info('logs:view:start')
|
||||
log_file = settings.LOG_DIR / 'camlaps.log'
|
||||
lines = []
|
||||
@@ -106,6 +108,7 @@ def clear_worker_logs(request):
|
||||
|
||||
@require_POST
|
||||
def start_queue(request):
|
||||
"""Запускает воркер одним проходом для следующей задачи из очереди."""
|
||||
logger.info('queue:start_request:start')
|
||||
|
||||
has_planned = TimelapseJob.objects.filter(status=TimelapseJob.Status.PLANNED).exists()
|
||||
@@ -135,6 +138,7 @@ def start_queue(request):
|
||||
|
||||
@require_POST
|
||||
def retry_job(request, job_id: int):
|
||||
"""Сбрасывает задачу в planned для повторного запуска после ошибки."""
|
||||
logger.info('job:retry:start job_id=%s', job_id)
|
||||
job = get_object_or_404(TimelapseJob, pk=job_id)
|
||||
|
||||
@@ -194,6 +198,7 @@ def job_detail(request, job_id: int):
|
||||
|
||||
@require_POST
|
||||
def run_job_now(request, job_id: int):
|
||||
"""Немедленно запускает конкретную задачу через management command."""
|
||||
logger.info('job:run_now:start job_id=%s', job_id)
|
||||
job = get_object_or_404(TimelapseJob, pk=job_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user