refactor: less noisy logging
This commit is contained in:
parent
6f392d20d5
commit
ade858598b
@ -43,9 +43,7 @@ func pullRecordings() {
|
||||
|
||||
client := twilio.NewRestClient()
|
||||
for {
|
||||
fmt.Println("sleeping for 5 minutes...")
|
||||
time.Sleep(300 * time.Second)
|
||||
fmt.Println("waking up & polling for recordings...")
|
||||
|
||||
resp, err := client.Api.ListRecording(&api.ListRecordingParams{})
|
||||
if err != nil {
|
||||
@ -54,13 +52,11 @@ func pullRecordings() {
|
||||
}
|
||||
|
||||
if len(resp) == 0 {
|
||||
fmt.Println("no recordings, sleeping again!")
|
||||
continue
|
||||
}
|
||||
|
||||
for _, rec := range resp {
|
||||
medUrl := *rec.MediaUrl
|
||||
fmt.Printf("attempting to download %s\n", medUrl)
|
||||
parsed, err := url.Parse(medUrl)
|
||||
if err != nil {
|
||||
fmt.Printf("failed to parse %s: %s\n", medUrl, err)
|
||||
@ -76,7 +72,6 @@ func pullRecordings() {
|
||||
continue
|
||||
}
|
||||
|
||||
fmt.Printf("attempting to delete %s\n", medUrl)
|
||||
err = client.Api.DeleteRecording(*rec.Sid, &api.DeleteRecordingParams{})
|
||||
if err != nil {
|
||||
fmt.Printf("failed to delete %s: %s\n", medUrl, err)
|
||||
@ -103,9 +98,7 @@ func main() {
|
||||
}
|
||||
})
|
||||
|
||||
fmt.Println("firing up recording downloader / deleter")
|
||||
go pullRecordings()
|
||||
|
||||
fmt.Println("running server...")
|
||||
router.Run(":1312")
|
||||
}
|
||||
|
Reference in New Issue
Block a user