Fixed metadata and tags not storing to capture DB on update or exit

This commit is contained in:
Joel Collins 2019-02-13 15:17:52 +00:00
parent 7b7a8dfb4a
commit ed12cc7bce
3 changed files with 24 additions and 1 deletions

View file

@ -103,8 +103,15 @@ app.register_blueprint(task_blueprint, url_prefix=uri('/task', 'v1'))
def cleanup():
global api_microscope
logging.debug("App teardown started...")
# Save config
api_microscope.rc.save(backup=True)
if api_microscope.rc:
api_microscope.rc.save(backup=True)
# Update capture DB and metadata files before exiting
if api_microscope.camera:
api_microscope.camera.store_captures()
# Close down the microscope
api_microscope.close()
logging.debug("App teardown complete.")