The downloadDatabases function awaits cleanupHotDownloadDir under the assumption that the cleanup has finished when the promise resolves.
cleanupHotDownloadDir however did not return a promise, as a consequence the downloadDatabases does not wait for the actual delete.
We've experienced several instances of our services failing to start because the target directory for the downloads do not exist. This happens when the cleanup happens after the fs.mkdirSync. This could happen if cleanup runs slower than the fs.mkdirSync call.
The
downloadDatabases
function awaitscleanupHotDownloadDir
under the assumption that the cleanup has finished when the promise resolves.cleanupHotDownloadDir
however did not return a promise, as a consequence thedownloadDatabases
does not wait for the actual delete.We've experienced several instances of our services failing to start because the target directory for the downloads do not exist. This happens when the cleanup happens after the
fs.mkdirSync
. This could happen if cleanup runs slower than thefs.mkdirSync
call.