From f43314648404ebd53604c87d2bfa55c363284982 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 21 Jun 2021 11:53:25 -0700 Subject: [PATCH] volumes: reload sftp on update when diskPath changes, docker is busy holding on to the previous mount! I guess this is because this is all somehow inode based. --- src/volumes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/volumes.js b/src/volumes.js index cd07b7eaf..6419256ed 100644 --- a/src/volumes.js +++ b/src/volumes.js @@ -122,6 +122,9 @@ async function update(volume, mountType, mountOptions) { const result = await database.query('UPDATE volumes SET mountOptionsJson=? WHERE id=?', [ JSON.stringify(mountOptions), volume.id ]); if (result.affectedRows !== 1) throw new BoxError(BoxError.NOT_FOUND, 'Volume not found'); + + // when diskPath or remoteDir is changed, we have to "rebind" the docker volumes + services.rebuildService('sftp', NOOP_CALLBACK); } async function getStatus(volume) {