mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Merge pull request #3436 from mikiher/create-playback-session-race-condition
Change PlaybackSession createFromOld to use upsert instead of create
This commit is contained in:
commit
013c7c776e
@ -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)
|
||||
})
|
||||
}
|
||||
|
@ -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
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user