add throttling to image download

This commit is contained in:
2024-01-24 18:35:06 +01:00
committed by T.v.Dein
parent de82127223
commit 8df3ebfa6d
4 changed files with 23 additions and 2 deletions

View File

@@ -22,8 +22,10 @@ import (
"fmt"
"io"
"log/slog"
"math/rand"
"os"
"runtime/debug"
"time"
"github.com/lmittmann/tint"
"github.com/tlinden/yadu"
@@ -113,6 +115,9 @@ func Main(w io.Writer) int {
// used for all HTTP requests
fetch := NewFetcher(conf)
// randomization needed here and there
rand.Seed(time.Now().UnixNano())
if len(conf.Adlinks) >= 1 {
// directly backup ad listing[s]
for _, uri := range conf.Adlinks {