avoid useless stacktraces in celery log
This commit is contained in:
parent
0cdaec1862
commit
8b119c00c0
1 changed files with 11 additions and 6 deletions
|
@ -1,5 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from celery.exceptions import MaxRetriesExceededError
|
||||||
from django.db import DatabaseError
|
from django.db import DatabaseError
|
||||||
from django.utils.formats import date_format
|
from django.utils.formats import date_format
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
@ -19,12 +20,16 @@ def process_map_updates(self):
|
||||||
|
|
||||||
from c3nav.mapdata.models import MapUpdate
|
from c3nav.mapdata.models import MapUpdate
|
||||||
try:
|
try:
|
||||||
updates = MapUpdate.process_updates()
|
try:
|
||||||
except DatabaseError:
|
updates = MapUpdate.process_updates()
|
||||||
if self.request.called_directly:
|
except DatabaseError:
|
||||||
raise
|
if self.request.called_directly:
|
||||||
logger.info('Processing is already running, retrying in 30 seconds.')
|
raise
|
||||||
raise self.retry(countdown=30)
|
logger.info('Processing is already running, retrying in 30 seconds.')
|
||||||
|
raise self.retry(countdown=30)
|
||||||
|
except MaxRetriesExceededError:
|
||||||
|
logger.info('Cannot retry, retries exceeded. Exiting.')
|
||||||
|
return
|
||||||
|
|
||||||
if updates:
|
if updates:
|
||||||
print()
|
print()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue