You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
All: Finished service to clean up resources
This commit is contained in:
@@ -22,6 +22,8 @@ const NoteTag = require('lib/models/NoteTag.js');
|
||||
const BaseItem = require('lib/models/BaseItem.js');
|
||||
const MasterKey = require('lib/models/MasterKey.js');
|
||||
const BaseModel = require('lib/BaseModel.js');
|
||||
const BaseService = require('lib/services/BaseService.js');
|
||||
const ResourceService = require('lib/services/ResourceService');
|
||||
const { JoplinDatabase } = require('lib/joplin-database.js');
|
||||
const { Database } = require('lib/database.js');
|
||||
const { NotesScreen } = require('lib/components/screens/notes.js');
|
||||
@@ -318,6 +320,8 @@ async function initialize(dispatch) {
|
||||
reg.setLogger(mainLogger);
|
||||
reg.setShowErrorMessageBoxHandler((message) => { alert(message) });
|
||||
|
||||
BaseService.logger_ = mainLogger;
|
||||
|
||||
reg.logger().info('====================================');
|
||||
reg.logger().info('Starting application ' + Setting.value('appId') + ' (' + Setting.value('env') + ')');
|
||||
|
||||
@@ -450,6 +454,12 @@ async function initialize(dispatch) {
|
||||
AlarmService.garbageCollect();
|
||||
}, 1000 * 60 * 60);
|
||||
|
||||
const resourceService = new ResourceService();
|
||||
resourceService.maintenance();
|
||||
PoorManIntervals.setInterval(() => {
|
||||
resourceService.maintenance();
|
||||
}, 1000 * 60 * 60 * 4);
|
||||
|
||||
reg.scheduleSync().then(() => {
|
||||
// Wait for the first sync before updating the notifications, since synchronisation
|
||||
// might change the notifications.
|
||||
|
||||
Reference in New Issue
Block a user