Bug #966

Updated by Matthieu Decorde almost 5 years ago

When an import module starts, it asks confirmation to replace original corpus.

Currently, the code seems to delete the original corpus binary.

If the import process is aborted, the original corpus is still present in the corpus view but "is not ready" in the messages bar and is not useable.

An import module abort should put a previously existing corpus back to its original state.

Solution:
* rename the original corpus binary in a temporary directory with the "_temp" suffix, instead of deleting it
* if import process is finished without error then delete the temporary directory
* otherwise
** rename the broken corpus directory with the "_error" suffix
** restore the original corpus binary back into the corpora directory.
* At each import process start, delete the "_error" and "_temp" directories

h3. Validation test
* starts an import TXT+CSV on a directory with some txt files
* starts an import TXT+CSV on an empty directory with the same name. The corpora directory should contains the "_error" directory. and the original one must still be ready
* starts an import TXT+CSV on a directory with some txt files. The corpora directory should contains the "_temp" directory during the import process. And deleted at the end of import

Back