From 35ec85f2db8c650bd7ee2cfbc6f3133b1ca4157f Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Fri, 14 Feb 2020 19:12:34 +0000
Subject: [PATCH] Limit the rate of liquidsoap restarts

---
 transcoder/transcoder.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/transcoder/transcoder.go b/transcoder/transcoder.go
index 31d65952..3157f860 100644
--- a/transcoder/transcoder.go
+++ b/transcoder/transcoder.go
@@ -89,6 +89,9 @@ func (t *transcoder) run(ctx context.Context) error {
 	cmd.Stderr = os.Stderr
 	err = cmd.Run()
 	if err != nil && err != context.Canceled {
+		// Sleeping here limits the rate of liquidsoap restart
+		// if we are crashlooping for whatever reason.
+		time.Sleep(1 * time.Second)
 		log.Printf("error: %s: liquidsoap failed: %v", t.mount.Path, err)
 	}
 	return err
-- 
GitLab