First pass at full fork pretty much complete.
This commit is contained in:
@@ -159,6 +159,7 @@ func main() {
|
||||
go func() {
|
||||
hall.Update()
|
||||
token.Expire()
|
||||
cleanupRecordings()
|
||||
}()
|
||||
case <-slowTicker.C:
|
||||
go relayTest()
|
||||
@@ -169,6 +170,29 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
func cleanupRecordings() {
|
||||
conf, err := hall.GetConfiguration()
|
||||
if err != nil {
|
||||
log.Printf("Recording cleanup: %v", err)
|
||||
return
|
||||
}
|
||||
if conf.RecordingRetention == "" {
|
||||
return
|
||||
}
|
||||
retention, err := time.ParseDuration(conf.RecordingRetention)
|
||||
if err != nil {
|
||||
log.Printf("Recording cleanup: bad recordingRetention %q: %v",
|
||||
conf.RecordingRetention, err)
|
||||
return
|
||||
}
|
||||
if retention <= 0 {
|
||||
return
|
||||
}
|
||||
if err := diskwriter.CleanupOldRecordings(retention); err != nil {
|
||||
log.Printf("Recording cleanup: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func relayTest() {
|
||||
now := time.Now()
|
||||
d, err := ice.RelayTest(20 * time.Second)
|
||||
|
||||
Reference in New Issue
Block a user