gcollazo / ember-cli-addon-search

This project is no longer maintained please visit Ember Observer

Home Page:https://emberobserver.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

the JSON generator should create the file, and once done override the old one

huafu opened this issue · comments

It's often that the app is having a broken JSON data as source, like if it was a partial of the full one. I do believe that it might be updated in-place on the server, and since it might take some time, the client is then reading a partially done JSON.

If that is the case, it'll be better to create a buffer/temp file first, then once this file is saved and done writing, move it to override the JSON file used by http query done in the frontend's store.

I haven't noticed the issue but I can confirm that is the case. I just overwrite the old file with the new file.

What I can do is upload the new file to data.tmp.json once that finishes uploading, copy it (hopefuly in place) to data.json. We can't just rename the file since we are using s3 for storage, we have to delete the old file and copy the new file to the location of the old file. Thoughts?