volumes: only wait for 5 seconds for mount status

mountpoint -q can never exit if the nfs mount disappears, for example
This commit is contained in:
Girish Ramakrishnan
2024-02-20 21:38:54 +01:00
parent 26eb739b46
commit 3da3ccedcb
3 changed files with 13 additions and 6 deletions
+2 -1
View File
@@ -257,7 +257,8 @@ async function testConfig(apiConfig) {
}
if (apiConfig.provider === PROVIDER_MOUNTPOINT) {
if (!safe.child_process.execSync(`mountpoint -q -- ${apiConfig.mountPoint}`)) throw new BoxError(BoxError.BAD_FIELD, `${apiConfig.mountPoint} is not mounted`);
const [error] = await safe(shell.exec(`mountpoint -q -- ${apiConfig.mountPoint}`, { timeout: 5000 }));
if (error) throw new BoxError(BoxError.BAD_FIELD, `${apiConfig.mountPoint} is not mounted: ${error.message}`);
}
const rootPath = apiConfig.rootPath;