You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
Cli: Fix last change sometimes lost when not in TUI mode (#13090)
This commit is contained in:
@@ -432,6 +432,7 @@ class Application extends BaseApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await Setting.saveAll();
|
await Setting.saveAll();
|
||||||
|
await this.database_.close();
|
||||||
|
|
||||||
// Need to call exit() explicitly, otherwise Node wait for any timeout to complete
|
// Need to call exit() explicitly, otherwise Node wait for any timeout to complete
|
||||||
// https://stackoverflow.com/questions/18050095
|
// https://stackoverflow.com/questions/18050095
|
||||||
|
|||||||
@@ -90,8 +90,7 @@ export default class BaseApplication {
|
|||||||
private eventEmitter_: any;
|
private eventEmitter_: any;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private scheduleAutoAddResourcesIID_: any = null;
|
private scheduleAutoAddResourcesIID_: any = null;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
protected database_: JoplinDatabase = null;
|
||||||
private database_: any = null;
|
|
||||||
private profileConfig_: ProfileConfig = null;
|
private profileConfig_: ProfileConfig = null;
|
||||||
|
|
||||||
protected showStackTraces_ = false;
|
protected showStackTraces_ = false;
|
||||||
|
|||||||
@@ -16,6 +16,12 @@ class DatabaseDriverNode {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
close() {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
this.db_.close(() => resolve());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
sqliteErrorToJsError(error, sql = null, params = null) {
|
sqliteErrorToJsError(error, sql = null, params = null) {
|
||||||
const msg = [error.toString()];
|
const msg = [error.toString()];
|
||||||
if (sql) msg.push(sql);
|
if (sql) msg.push(sql);
|
||||||
|
|||||||
@@ -65,6 +65,14 @@ export default class Database {
|
|||||||
this.logger().info('Database was open successfully');
|
this.logger().info('Database was open successfully');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async close() {
|
||||||
|
try {
|
||||||
|
await this.driver().close?.();
|
||||||
|
} catch (error) {
|
||||||
|
this.logger().warn('Failed to close database', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public escapeField(field: string) {
|
public escapeField(field: string) {
|
||||||
if (field === '*') return '*';
|
if (field === '*') return '*';
|
||||||
const p = field.split('.');
|
const p = field.split('.');
|
||||||
|
|||||||
Reference in New Issue
Block a user