From 942bd0859fff6c185430dc7811d81945e1f3e0e5 Mon Sep 17 00:00:00 2001 From: mikiher Date: Wed, 18 Sep 2024 18:01:36 +0300 Subject: [PATCH 1/2] Change PlaybackSession createFromOld to use upsert instead of create --- server/models/PlaybackSession.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/models/PlaybackSession.js b/server/models/PlaybackSession.js index 5442387f63..c7c6323af6 100644 --- a/server/models/PlaybackSession.js +++ b/server/models/PlaybackSession.js @@ -117,7 +117,7 @@ class PlaybackSession extends Model { static createFromOld(oldPlaybackSession) { const playbackSession = this.getFromOld(oldPlaybackSession) - return this.create(playbackSession, { + return this.upsert(playbackSession, { silent: true }) } From d796849d7471b7af6c9a665dd89137051468a69e Mon Sep 17 00:00:00 2001 From: mikiher Date: Wed, 18 Sep 2024 18:44:16 +0300 Subject: [PATCH 2/2] Small change to logging of unhandled rejections --- server/Server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Server.js b/server/Server.js index 8bbfa4d34a..17466e863c 100644 --- a/server/Server.js +++ b/server/Server.js @@ -182,7 +182,7 @@ class Server { * @see https://nodejs.org/api/process.html#event-unhandledrejection */ process.on('unhandledRejection', async (reason, promise) => { - await Logger.fatal(`[Server] Unhandled rejection: ${reason}, promise:`, util.format('%O', promise)) + await Logger.fatal('[Server] Unhandled rejection:', reason, '\npromise:', util.format('%O', promise)) process.exit(1) }) }