yaronkoren / miga

A Javascript application (with some PHP) for viewing and browsing arbitrary structured data
GNU General Public License v3.0
20 stars 7 forks source link

Be more careful when building a new CSV #7

Open jthingelstad opened 11 years ago

jthingelstad commented 11 years ago

While running the importer Miga should take more care with the existing CSV. Ideally:

  1. Leave the existing CSV alone.
  2. Create the new file using a temp filename.
  3. If fails, leave temp file for debugging and give error.
  4. If success, move original CSV to an archive name and swap in new CSV.

Currently while building a large data set users could get partial results. Also, a failed rebuild destroys your currently working data.