openworm / owmeta-core

Core library for owmeta
MIT License
3 stars 2 forks source link

Ensure that `owm regendb` restores the pre-existing DB if the command is aborted. #29

Open mwatts15 opened 3 years ago

mwatts15 commented 3 years ago

The owm regendb command deletes the existing indexed database before creating a new one. If there's an interruption in generating the new database, such as by the user typing CTRL-C, the old database is not available, which can be surprising given that canceling would generally be expected to leave things in their state from before the whole process began. To fix this issue, ensure the original database is restored in case regenerating the database fails.