From 19dbfa34bfdbae7870ea2ac5200ef717459bbdc7 Mon Sep 17 00:00:00 2001 From: Norwin Roosen Date: Thu, 31 Dec 2020 07:10:30 +0100 Subject: [PATCH] avoid killing the server with too many conns --- pixelflut/api.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pixelflut/api.go b/pixelflut/api.go index 6d12f5f..954087e 100644 --- a/pixelflut/api.go +++ b/pixelflut/api.go @@ -8,6 +8,7 @@ import ( "log" "net" "sync" + "time" "github.com/SpeckiJ/Hochwasser/render" ) @@ -53,6 +54,8 @@ func Flut(img *image.NRGBA, position image.Point, shuffle, rgbsplit, randoffset msg = messages[i] } + time.Sleep(66 * time.Millisecond) // avoid crashing the server + go bombAddress(msg, address, maxOffsetX, maxOffsetY, stop, &bombWg) } bombWg.Wait()