avoid killing the server with too many conns
This commit is contained in:
parent
6f2e2fd666
commit
19dbfa34bf
|
@ -8,6 +8,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/SpeckiJ/Hochwasser/render"
|
"github.com/SpeckiJ/Hochwasser/render"
|
||||||
)
|
)
|
||||||
|
@ -53,6 +54,8 @@ func Flut(img *image.NRGBA, position image.Point, shuffle, rgbsplit, randoffset
|
||||||
msg = messages[i]
|
msg = messages[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time.Sleep(66 * time.Millisecond) // avoid crashing the server
|
||||||
|
|
||||||
go bombAddress(msg, address, maxOffsetX, maxOffsetY, stop, &bombWg)
|
go bombAddress(msg, address, maxOffsetX, maxOffsetY, stop, &bombWg)
|
||||||
}
|
}
|
||||||
bombWg.Wait()
|
bombWg.Wait()
|
||||||
|
|
Loading…
Reference in New Issue