refactor: partial state updates (#780)

* refactor: partial state updates

* refactor: less calls to restore

* refactor: add error stack trace to log
This commit is contained in:
Carlos Valente
2024-02-19 21:31:27 +01:00
committed by GitHub
parent c890251dad
commit 7ff75835ff
22 changed files with 523 additions and 361 deletions
+4 -1
View File
@@ -43,7 +43,8 @@ import { restoreService } from './services/RestoreService.js';
import { messageService } from './services/message-service/MessageService.js';
import { populateDemo } from './modules/loadDemo.js';
import { getState, updateRundownData } from './stores/runtimeState.js';
import { setRundown, getPlayableEvents } from './services/rundown-service/RundownService.js';
import { setRundown } from './services/rundown-service/RundownService.js';
import { getPlayableEvents } from './services/rundown-service/rundownUtils.js';
console.log(`Starting Ontime version ${ONTIME_VERSION}`);
@@ -284,11 +285,13 @@ export const shutdown = async (exitCode = 0) => {
process.on('exit', (code) => console.log(`Ontime shutdown with code: ${code}`));
process.on('unhandledRejection', async (error) => {
console.error('Error: unhandled rejection', error);
logger.error(LogOrigin.Server, `Error: unhandled rejection ${error}`);
await shutdown(1);
});
process.on('uncaughtException', async (error) => {
console.error('Error: uncaught exception', error);
logger.error(LogOrigin.Server, `Error: uncaught exception ${error}`);
await shutdown(1);
});