avoid killing the server with too many conns

This commit is contained in:
Norwin Roosen 2020-12-31 07:10:30 +01:00
parent 6f2e2fd666
commit 19dbfa34bf
No known key found for this signature in database
GPG Key ID: 24BC059DE24C43A3
1 changed files with 3 additions and 0 deletions

View File

@ -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()