mirror of
https://github.com/owncast/owncast.git
synced 2025-11-02 20:23:29 +08:00
proper cleanup and permission check for the hls directory (#1167)
* check error on hls cleanup * rm HLS directories before creating new ones * don't mask the variable * mv cleanupDirectory() to utils * add user-friendly error messages
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/owncast/owncast/config"
|
||||
"github.com/owncast/owncast/core/data"
|
||||
"github.com/owncast/owncast/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@ -91,6 +92,9 @@ func handleTranscoderMessage(message string) {
|
||||
|
||||
func createVariantDirectories() {
|
||||
// Create private hls data dirs
|
||||
utils.CleanupDirectory(config.PublicHLSStoragePath)
|
||||
utils.CleanupDirectory(config.PrivateHLSStoragePath)
|
||||
|
||||
if len(data.GetStreamOutputVariants()) != 0 {
|
||||
for index := range data.GetStreamOutputVariants() {
|
||||
err := os.MkdirAll(path.Join(config.PrivateHLSStoragePath, strconv.Itoa(index)), 0777)
|
||||
|
||||
Reference in New Issue
Block a user