NCBI FTP - Handle the folder issue in the `tmp` folder as we run the script frequently and chances are there to send the package multiple times
Handle the folder issue in the tmp
folder as we run the script frequently and chances are there to send the package multiple times.
root@3c25b642f55c:~# node --harmony-promise-finally server/ncbi-integration/toNcbi
info: ncbi check in 9 ms
info: Sending package EMS90394 to ncbi FTP location.
info: ncbi-integration/toNcbi: closing connection to the database...
error: Unhandled Rejection at Promise: Promise {
<rejected> { Error: EEXIST: file already exists, mkdir '/tmp/ems90394'
errno: -17,
code: 'EEXIST',
syscall: 'mkdir',
path: '/tmp/ems90394' } }
error: Reason: message=EEXIST: file already exists, mkdir '/tmp/ems90394', stack=Error: EEXIST: file already exists, mkdir '/tmp/ems90394', errno=-17, code=EEXIST, syscall=mkdir, path=/tmp/ems90394
info: ncbi-integration/toNcbi: closing connection to the database...