Fix for premature staging file deletion for issue#76
Issue: Staging file is getting deleted prematurely when there is an issue in POST files/metadata. Problem: Staging file was getting deleted before the function is completely finished. So in the next iteration the file will not be available failing the next requests.
Resolution:
- Delete the file as the last step of saving metadata process.
- Catch and ignore if any exception is thrown while deleting the staging file (rare scenario)
- Check if the staging file is present before attempting to delete the record.
Implementation:
- All three above changes made inside saveMetadata
- Test added to cover the exceptional scenario.
The issue is explained in more detail here: #76 (closed)
Edited by Deepa Kumari