pcdshub / happi

Heuristic Access to Positions of Photon Instruments
https://pcdshub.github.io/happi/master
Other
13 stars 29 forks source link

Remove temporary file in JSON backend store function #330

Closed laura-king closed 1 year ago

laura-king commented 1 year ago

Description

Motivation and Context

Closes #304

If an error causes the temporary file in the json backend to not get copied properly, it would previously remain in the directory. It has not been needed so it will now be removed if left behind.

In addition, because this file is no longer needed, the datetime and username are no longer needed in the file name. It is now just the unique hash to prevent collisions. Imports previously used to add time and username are now removed from the file.

How Has This Been Tested?

Interactively, and a new test in test-backends.py

Where Has This Been Documented?

Issues #303, #304

Comments within function itself and test.

Pre-merge checklist