Start cleaning up linter errors. (#358)
* Start cleaning up linter errors. For #357 * Fix unmarshalling NullTime values * More linter fixes * Remove commented code * Move defer up * Consolidate error check lines * Move error check to make sure row iteration was successful * Cleaner error check + do not recreate pipe if it exists * Consolidate hashing to generate client id
This commit is contained in:
@@ -23,11 +23,8 @@ func (s *LocalStorage) Setup() error {
|
||||
// as all HLS segments have to be publicly available on disk to keep a recording of them.
|
||||
_onlineCleanupTicker = time.NewTicker(1 * time.Minute)
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-_onlineCleanupTicker.C:
|
||||
ffmpeg.CleanupOldContent(config.PublicHLSStoragePath)
|
||||
}
|
||||
for range _onlineCleanupTicker.C {
|
||||
ffmpeg.CleanupOldContent(config.PublicHLSStoragePath)
|
||||
}
|
||||
}()
|
||||
return nil
|
||||
@@ -35,7 +32,10 @@ func (s *LocalStorage) Setup() error {
|
||||
|
||||
// SegmentWritten is called when a single segment of video is written.
|
||||
func (s *LocalStorage) SegmentWritten(localFilePath string) {
|
||||
s.Save(localFilePath, 0)
|
||||
_, err := s.Save(localFilePath, 0)
|
||||
if err != nil {
|
||||
log.Warnln(err)
|
||||
}
|
||||
}
|
||||
|
||||
// VariantPlaylistWritten is called when a variant hls playlist is written.
|
||||
@@ -49,7 +49,10 @@ func (s *LocalStorage) VariantPlaylistWritten(localFilePath string) {
|
||||
|
||||
// MasterPlaylistWritten is called when the master hls playlist is written.
|
||||
func (s *LocalStorage) MasterPlaylistWritten(localFilePath string) {
|
||||
s.Save(localFilePath, 0)
|
||||
_, err := s.Save(localFilePath, 0)
|
||||
if err != nil {
|
||||
log.Warnln(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Save will save a local filepath using the storage provider.
|
||||
@@ -63,7 +66,6 @@ func (s *LocalStorage) Save(filePath string, retryCount int) (string, error) {
|
||||
newPath = filepath.Join(config.WebRoot, filePath)
|
||||
}
|
||||
|
||||
utils.Copy(filePath, newPath)
|
||||
|
||||
return newPath, nil
|
||||
err := utils.Copy(filePath, newPath)
|
||||
return newPath, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user