diff --git a/src/adapters/ipfs/index.js b/src/adapters/ipfs/index.js index 1fd7fb8..320fb87 100644 --- a/src/adapters/ipfs/index.js +++ b/src/adapters/ipfs/index.js @@ -38,6 +38,13 @@ class IPFS { return true } catch (err) { console.error('Error in adapters/ipfs/index.js/start()') + + // If error is due to a lock file issue. Kill the process, so that + // Docker or pm2 has a chance to restart the service. + if (err.message.includes('Lock already being held')) { + process.exit(1) + } + throw err } }