When SQLITE_CORRUPT error happens, immediately restart the app
This commit is contained in:
parent
43ac8ce37e
commit
b77246a7e0
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue