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
|
||||
|
||||
from celery.exceptions import MaxRetriesExceededError
|
||||
from django.db import DatabaseError
|
||||
from django.utils.formats import date_format
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
@ -19,12 +20,16 @@ def process_map_updates(self):
|
|||
|
||||
from c3nav.mapdata.models import MapUpdate
|
||||
try:
|
||||
updates = MapUpdate.process_updates()
|
||||
except DatabaseError:
|
||||
if self.request.called_directly:
|
||||
raise
|
||||
logger.info('Processing is already running, retrying in 30 seconds.')
|
||||
raise self.retry(countdown=30)
|
||||
try:
|
||||
updates = MapUpdate.process_updates()
|
||||
except DatabaseError:
|
||||
if self.request.called_directly:
|
||||
raise
|
||||
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:
|
||||
print()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue