Fix "invalid cross-device link" error when running on a different filesystem (#1769)
* fix cross-device rename errors * fallback to copy instead of always using it * use tmp dir in data folder * recreate tmp dir at startup
This commit is contained in:
@@ -106,7 +106,7 @@ func fireThumbnailGenerator(segmentPath string, variantIndex int) error {
|
||||
}
|
||||
|
||||
// rename temp file
|
||||
if err := os.Rename(outputFileTemp, outputFile); err != nil {
|
||||
if err := utils.Move(outputFileTemp, outputFile); err != nil {
|
||||
log.Errorln(err)
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ func makeAnimatedGifPreview(sourceFile string, outputFile string) {
|
||||
if _, err := exec.Command("sh", "-c", ffmpegCmd).Output(); err != nil {
|
||||
log.Errorln(err)
|
||||
// rename temp file
|
||||
} else if err := os.Rename(outputFileTemp, outputFile); err != nil {
|
||||
} else if err := utils.Move(outputFileTemp, outputFile); err != nil {
|
||||
log.Errorln(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user