mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
Do not auto-delete file on storage save. Add firing cleanup method
This commit is contained in:
parent
2647b3fac8
commit
d403fd20f1
@ -6,6 +6,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
|
"github.com/owncast/owncast/core/ffmpeg"
|
||||||
"github.com/owncast/owncast/core/playlist"
|
"github.com/owncast/owncast/core/playlist"
|
||||||
"github.com/owncast/owncast/utils"
|
"github.com/owncast/owncast/utils"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
@ -99,10 +100,6 @@ func (s *S3Storage) SegmentWritten(localFilePath string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a segment file was successfully uploaded then we can delete
|
|
||||||
// it from the local filesystem.
|
|
||||||
os.Remove(localFilePath)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// VariantPlaylistWritten is called when a variant hls playlist is written
|
// VariantPlaylistWritten is called when a variant hls playlist is written
|
||||||
@ -163,6 +160,8 @@ func (s *S3Storage) Save(filePath string, retryCount int) (string, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ffmpeg.Cleanup(filepath.Dir(filePath))
|
||||||
|
|
||||||
return response.Location, nil
|
return response.Location, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user