When SQLITE_CORRUPT error happens, immediately restart the app

This commit is contained in:
Scott Nonnenberg 2019-09-19 15:14:14 -07:00
parent 43ac8ce37e
commit b77246a7e0

View file

@ -281,6 +281,14 @@ function _updateJob(id, data) {
window.log.info(
`SQL channel job ${id} (${fnName}) failed in ${end - start}ms`
);
if (error && error.message && error.message.includes('SQLITE_CORRUPT')) {
window.log.error(
'Detected SQLITE_CORRUPT error; restarting the application immediately'
);
window.restart();
}
return reject(error);
},
};