mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
logging reason for frontend reload
This commit is contained in:
parent
9767b6269a
commit
e5555beea9
@ -63,10 +63,10 @@ function load() {
|
||||
log.info(`Becca (note cache) load took ${Date.now() - start}ms`);
|
||||
}
|
||||
|
||||
function reload() {
|
||||
function reload(reason) {
|
||||
load();
|
||||
|
||||
require('../services/ws').reloadFrontend();
|
||||
require('../services/ws').reloadFrontend(reason || "becca reloaded");
|
||||
}
|
||||
|
||||
eventService.subscribeBeccaLoader([eventService.ENTITY_CHANGE_SYNCED], ({entityName, entityRow}) => {
|
||||
|
@ -763,7 +763,7 @@ class ConsistencyChecks {
|
||||
}
|
||||
|
||||
if (this.reloadNeeded) {
|
||||
require("../becca/becca_loader").reload();
|
||||
require("../becca/becca_loader").reload("consistency checks need becca reload");
|
||||
}
|
||||
|
||||
return !this.unrecoveredConsistencyErrors;
|
||||
|
@ -60,7 +60,7 @@ function checkProtectedSessionExpiration() {
|
||||
|
||||
log.info("Expiring protected session");
|
||||
|
||||
require('./ws').reloadFrontend();
|
||||
require('./ws').reloadFrontend("leaving protected session");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ const env = require('./env');
|
||||
if (env.isDev()) {
|
||||
const chokidar = require('chokidar');
|
||||
const debounce = require('debounce');
|
||||
const debouncedReloadFrontend = debounce(reloadFrontend, 200);
|
||||
const debouncedReloadFrontend = debounce(() => reloadFrontend("source code change"), 200);
|
||||
chokidar
|
||||
.watch('src/public')
|
||||
.on('add', debouncedReloadFrontend)
|
||||
@ -230,8 +230,8 @@ function syncFailed() {
|
||||
sendMessageToAllClients({ type: 'sync-failed', lastSyncedPush });
|
||||
}
|
||||
|
||||
function reloadFrontend() {
|
||||
sendMessageToAllClients({ type: 'reload-frontend' });
|
||||
function reloadFrontend(reason) {
|
||||
sendMessageToAllClients({ type: 'reload-frontend', reason });
|
||||
}
|
||||
|
||||
function setLastSyncedPush(entityChangeId) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user