Fixes #5 #6

Merged
dafo5502 merged 5 commits from developer into master 2021-10-27 09:59:42 +02:00
2 changed files with 2 additions and 0 deletions
Showing only changes of commit ec549a99b4 - Show all commits

View File

@ -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)

View File

@ -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