Fixes #5 #6
@ -52,6 +52,7 @@ class Daemon:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = "Exception during processing of queue item %s: %s"
|
msg = "Exception during processing of queue item %s: %s"
|
||||||
self.logger.exception(msg, pres_id, queue_item, exc_info=e)
|
self.logger.exception(msg, pres_id, queue_item, exc_info=e)
|
||||||
|
# write the que info and error to disk for play-api to display the status
|
||||||
with open(os.path.join(self.error_dir, pres_id), 'w') as f:
|
with open(os.path.join(self.error_dir, pres_id), 'w') as f:
|
||||||
queue_item['error'] = e
|
queue_item['error'] = e
|
||||||
json.dump(queue_item, f)
|
json.dump(queue_item, f)
|
||||||
|
@ -170,6 +170,7 @@ class Pipeline:
|
|||||||
# Delete queue file and upload data
|
# Delete queue file and upload data
|
||||||
os.remove(os.path.join(self.queue, target_id))
|
os.remove(os.path.join(self.queue, target_id))
|
||||||
try:
|
try:
|
||||||
|
# if any old error file remove it since now iot has worked
|
||||||
os.remove(os.path.join(self.error, target_id))
|
os.remove(os.path.join(self.error, target_id))
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user