Skip to content

Commit

Permalink
Add pause after completing google drive export
Browse files Browse the repository at this point in the history
Closes #88
  • Loading branch information
alxndrsn committed Oct 24, 2018
1 parent a1303fc commit c57649c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v1.18.10
* Add pause after completing google drive export

## v1.18.9
* Update project layout documentation
* [reject-excluded-tests] update error message for consistency
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "medic-conf",
"version": "1.18.9",
"version": "1.18.10",
"description": "Configure Medic Mobile deployments",
"main": "index.js",
"scripts": {
Expand Down
8 changes: 7 additions & 1 deletion src/fn/fetch-forms-from-google-drive.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ module.exports = projectDir => {
const forms = fs.readJson(`${projectDir}/forms-on-google-drive.json`);

return Object.keys(forms)
.reduce(fetchForm, Promise.resolve());
.reduce(fetchForm, Promise.resolve())
.then(() => new Promise(resolve => {
// Here we pause to avoid a suspected race condition when trying to
// access the last-written xlsx file. Reported at
// https://github.com/medic/medic-conf/issues/88
setTimeout(resolve, 500);
}));

function fetchForm(promiseChain, localName) {
return promiseChain
Expand Down

0 comments on commit c57649c

Please sign in to comment.