add error logging while processing location data
This commit is contained in:
parent
091723d2ac
commit
e16872effe
@ -11,6 +11,7 @@ log = logging.getLogger(__name__)
|
|||||||
def process_location_data():
|
def process_location_data():
|
||||||
data = LocationData.objects.filter(processed=False).order_by('tst')
|
data = LocationData.objects.filter(processed=False).order_by('tst')
|
||||||
for ld in data:
|
for ld in data:
|
||||||
|
try:
|
||||||
cli = Client.objects.filter(uuid=ld.client_id, desks__desk_no=ld.desk_no)
|
cli = Client.objects.filter(uuid=ld.client_id, desks__desk_no=ld.desk_no)
|
||||||
if cli.count() < 1:
|
if cli.count() < 1:
|
||||||
ld.processed = True
|
ld.processed = True
|
||||||
@ -60,3 +61,5 @@ def process_location_data():
|
|||||||
ld.error_msg = 'No existing accountings found. Stopp processing! {}, {}'.format(ld.client_id, ld.desk_no)
|
ld.error_msg = 'No existing accountings found. Stopp processing! {}, {}'.format(ld.client_id, ld.desk_no)
|
||||||
ld.save()
|
ld.save()
|
||||||
log.error(ld.error_msg)
|
log.error(ld.error_msg)
|
||||||
|
except:
|
||||||
|
log.exception('', exc_info=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user