подправил логику работы проги
All checks were successful
Deploy timelaps / deploy (push) Successful in 5s
All checks were successful
Deploy timelaps / deploy (push) Successful in 5s
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user