diff options
author | Chocobozzz <me@florianbigard.com> | 2018-12-11 15:12:38 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-12-11 15:12:38 +0100 |
commit | f481c4f9f31e897a08e818f388fecdee07f57142 (patch) | |
tree | 2a47adb746d7bfc5046fa7e610408223c921db83 /server/lib/job-queue | |
parent | 14e2014acc1362cfbb770c051a7254b156cd8efb (diff) | |
download | PeerTube-f481c4f9f31e897a08e818f388fecdee07f57142.tar.gz PeerTube-f481c4f9f31e897a08e818f388fecdee07f57142.tar.zst PeerTube-f481c4f9f31e897a08e818f388fecdee07f57142.zip |
Use move instead rename
To avoid EXDEV errors
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r-- | server/lib/job-queue/handlers/video-import.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts index 51a0b5faf..63aacff98 100644 --- a/server/lib/job-queue/handlers/video-import.ts +++ b/server/lib/job-queue/handlers/video-import.ts | |||
@@ -14,7 +14,7 @@ import { federateVideoIfNeeded } from '../../activitypub' | |||
14 | import { VideoModel } from '../../../models/video/video' | 14 | import { VideoModel } from '../../../models/video/video' |
15 | import { downloadWebTorrentVideo } from '../../../helpers/webtorrent' | 15 | import { downloadWebTorrentVideo } from '../../../helpers/webtorrent' |
16 | import { getSecureTorrentName } from '../../../helpers/utils' | 16 | import { getSecureTorrentName } from '../../../helpers/utils' |
17 | import { remove, rename, stat } from 'fs-extra' | 17 | import { remove, move, stat } from 'fs-extra' |
18 | 18 | ||
19 | type VideoImportYoutubeDLPayload = { | 19 | type VideoImportYoutubeDLPayload = { |
20 | type: 'youtube-dl' | 20 | type: 'youtube-dl' |
@@ -139,7 +139,7 @@ async function processFile (downloader: () => Promise<string>, videoImport: Vide | |||
139 | 139 | ||
140 | // Move file | 140 | // Move file |
141 | videoDestFile = join(CONFIG.STORAGE.VIDEOS_DIR, videoImport.Video.getVideoFilename(videoFile)) | 141 | videoDestFile = join(CONFIG.STORAGE.VIDEOS_DIR, videoImport.Video.getVideoFilename(videoFile)) |
142 | await rename(tempVideoPath, videoDestFile) | 142 | await move(tempVideoPath, videoDestFile) |
143 | tempVideoPath = null // This path is not used anymore | 143 | tempVideoPath = null // This path is not used anymore |
144 | 144 | ||
145 | // Process thumbnail | 145 | // Process thumbnail |