Open
Description
diskusage package has a non deterministic behavior when calling diskusage.check("some-path/")
; it sometimes randomly rejects with the below error:
Error: ENOENT, No such file or directory '././clients-storages/main'
at check (/home/emran/dev/sls-for-iot/simulation/sls-sdk/node_modules/diskusage/index.js:23:21)
at /home/emran/dev/sls-for-iot/simulation/sls-sdk/node_modules/diskusage/index.js:10:5
at new Promise (<anonymous>)
at Object.exports.check (/home/emran/dev/sls-for-iot/simulation/sls-sdk/node_modules/diskusage/index.js:9:10)
at Function.<anonymous> (/home/emran/dev/sls-for-iot/simulation/sls-sdk/src/Utils.ts:6:46)
at Generator.next (<anonymous>)
at /home/emran/dev/sls-for-iot/simulation/sls-sdk/src/Utils.ts:8:71
at new Promise (<anonymous>)
at __awaiter (/home/emran/dev/sls-for-iot/simulation/sls-sdk/src/Utils.ts:4:12)
at Function.getSelfClientInfo (/home/emran/dev/sls-for-iot/simulation/sls-sdk/src/Utils.ts:16:16)
at AutoSyncedClientRepo.<anonymous> (/home/emran/dev/sls-for-iot/simulation/sls-sdk/src/AutoSyncedClientRepo.ts:35:46)
at Generator.next (<anonymous>)
at /home/emran/dev/sls-for-iot/simulation/sls-sdk/src/AutoSyncedClientRepo.ts:8:71
at new Promise (<anonymous>)
at __awaiter (/home/emran/dev/sls-for-iot/simulation/sls-sdk/src/AutoSyncedClientRepo.ts:4:12)
at AutoSyncedClientRepo.handlePing (/home/emran/dev/sls-for-iot/simulation/sls-sdk/src/AutoSyncedClientRepo.ts:37:16)
at Timeout._onTimeout (/home/emran/dev/sls-for-iot/simulation/sls-shared-utils/MqttSubscribeManager.ts:30:21)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7) {
errno: 2,
code: 'ENOENT',
path: '././clients-storages/main',
syscall: 'statvfs'
}
It's better to use check-disk-space package, instead.