mirror of
https://github.com/owncast/owncast.git
synced 2024-11-24 13:50:06 +03:00
Spawn go routine for saving segment
This commit is contained in:
parent
e8db314784
commit
6439075f36
1 changed files with 7 additions and 1 deletions
|
@ -96,7 +96,13 @@ func monitorVideoContent(pathToMonitor string, configuration Config, storage Chu
|
|||
writePlaylist(playlistString, path.Join(configuration.PublicHLSPath, relativePath))
|
||||
} else if filepath.Ext(event.Path) == ".ts" {
|
||||
segment := getSegmentFromPath(event.Path)
|
||||
|
||||
newObjectPathChannel := make(chan string, 1)
|
||||
go func() {
|
||||
newObjectPath := storage.Save(path.Join(configuration.PrivateHLSPath, segment.RelativeUploadPath))
|
||||
newObjectPathChannel <- newObjectPath
|
||||
}()
|
||||
newObjectPath := <-newObjectPathChannel
|
||||
segment.RemoteID = newObjectPath
|
||||
// fmt.Println("Uploaded", segment.RelativeUploadPath, "as", newObjectPath)
|
||||
|
||||
|
|
Loading…
Reference in a new issue