diff options
Diffstat (limited to 'server/lib/live')
-rw-r--r-- | server/lib/live/live-segment-sha-store.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/live/live-segment-sha-store.ts b/server/lib/live/live-segment-sha-store.ts index 17e0c6a82..1a0a93985 100644 --- a/server/lib/live/live-segment-sha-store.ts +++ b/server/lib/live/live-segment-sha-store.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { move, writeJson } from 'fs-extra' | 1 | import { rename, writeJson } from 'fs-extra' |
2 | import PQueue from 'p-queue' | 2 | import PQueue from 'p-queue' |
3 | import { basename } from 'path' | 3 | import { basename } from 'path' |
4 | import { mapToJSON } from '@server/helpers/core-utils' | 4 | import { mapToJSON } from '@server/helpers/core-utils' |
@@ -72,9 +72,9 @@ class LiveSegmentShaStore { | |||
72 | 72 | ||
73 | private writeToDisk () { | 73 | private writeToDisk () { |
74 | return this.writeQueue.add(async () => { | 74 | return this.writeQueue.add(async () => { |
75 | // Atomic write | 75 | // Atomic write: use rename instead of move that is not atomic |
76 | await writeJson(this.sha256PathTMP, mapToJSON(this.segmentsSha256)) | 76 | await writeJson(this.sha256PathTMP, mapToJSON(this.segmentsSha256)) |
77 | await move(this.sha256PathTMP, this.sha256Path, { overwrite: true }) | 77 | await rename(this.sha256PathTMP, this.sha256Path) |
78 | 78 | ||
79 | if (this.sendToObjectStorage) { | 79 | if (this.sendToObjectStorage) { |
80 | const url = await storeHLSFileFromPath(this.streamingPlaylist, this.sha256Path) | 80 | const url = await storeHLSFileFromPath(this.streamingPlaylist, this.sha256Path) |