kopia lustrzana https://github.com/OpenDroneMap/WebODM
Better exception handling, fixes
rodzic
9f674a1b41
commit
bf9a7ba718
|
@ -40,4 +40,4 @@ def boot():
|
||||||
scheduler.update_nodes_info(background=True)
|
scheduler.update_nodes_info(background=True)
|
||||||
|
|
||||||
except ProgrammingError:
|
except ProgrammingError:
|
||||||
logger.warn("Could not touch the database. If running a migration, this is expected.")
|
logger.warning("Could not touch the database. If running a migration, this is expected.")
|
|
@ -189,8 +189,8 @@ class Task(models.Model):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if self.processing_node:
|
if self.processing_node:
|
||||||
# Need to process some images (UUID not yet set)?
|
# Need to process some images (UUID not yet set and task not marked for deletion)?
|
||||||
if not self.uuid:
|
if not self.uuid and self.pending_action != pending_actions.REMOVE:
|
||||||
logger.info("Processing... {}".format(self))
|
logger.info("Processing... {}".format(self))
|
||||||
|
|
||||||
images = [image.path() for image in self.imageupload_set.all()]
|
images = [image.path() for image in self.imageupload_set.all()]
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import requests
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.contrib.postgres import fields
|
from django.contrib.postgres import fields
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
@ -84,7 +85,11 @@ class ProcessingNode(models.Model):
|
||||||
if len(images) < 2: raise ProcessingException("Need at least 2 images")
|
if len(images) < 2: raise ProcessingException("Need at least 2 images")
|
||||||
|
|
||||||
api_client = self.api_client()
|
api_client = self.api_client()
|
||||||
result = api_client.new_task(images, name, options)
|
try:
|
||||||
|
result = api_client.new_task(images, name, options)
|
||||||
|
except requests.exceptions.ConnectionError as e:
|
||||||
|
raise ProcessingException(e)
|
||||||
|
|
||||||
if result['uuid']:
|
if result['uuid']:
|
||||||
return result['uuid']
|
return result['uuid']
|
||||||
elif result['error']:
|
elif result['error']:
|
||||||
|
|
Ładowanie…
Reference in New Issue