refactor: less noisy logging

This commit is contained in:
decentral1se 2023-05-08 12:08:56 +02:00
parent 6f392d20d5
commit ade858598b
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 0 additions and 7 deletions

View File

@ -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")
}