подправил логику работы проги
All checks were successful
Deploy timelaps / deploy (push) Successful in 5s

This commit is contained in:
ack
2026-04-19 22:37:04 +03:00
parent 036797d94a
commit 34440ebf73
3 changed files with 16 additions and 4 deletions

View File

@@ -193,7 +193,7 @@ def run_job_now(request, job_id: int):
if job.status == TimelapseJob.Status.RUNNING:
logger.info('job:run_now:done job_id=%s blocked=running', job_id)
return redirect(f"{reverse('camlaps:job_detail', kwargs={'job_id': job_id})}?run_now=running")
return redirect(f"{reverse('camlaps:job_list')}?started=running")
cmd = [sys.executable, 'manage.py', 'run_timelapse_worker', '--job-id', str(job_id)]
kwargs = {
@@ -208,10 +208,10 @@ def run_job_now(request, job_id: int):
try:
subprocess.Popen(cmd, **kwargs)
logger.info('job:run_now:done job_id=%s worker_started=true', job_id)
return redirect(f"{reverse('camlaps:job_detail', kwargs={'job_id': job_id})}?run_now=started")
return redirect(f"{reverse('camlaps:job_list')}?started={job_id}")
except Exception:
logger.exception('job:run_now:error job_id=%s', job_id)
return redirect(f"{reverse('camlaps:job_detail', kwargs={'job_id': job_id})}?run_now=error")
return redirect(f"{reverse('camlaps:job_list')}?started=error")
def job_create(request, camera_id: int):