Another try to fix not removing last player.

This commit is contained in:
Sascha L. Teichmann 2022-02-28 21:26:04 +01:00
parent 6ffa0e1001
commit 6fb338dbb8
1 changed files with 5 additions and 1 deletions

View File

@ -133,13 +133,17 @@ func samePlayers(a, b []*player) bool {
func (ps *players) run() {
for {
ps.mu.Lock()
empty := len(ps.pls) == 0
ps.mu.Unlock()
pls, err := ps.readFromFIFO()
if err != nil {
//log.Printf("err: %s\n", err)
time.Sleep(sleepInterval)
continue
}
if pls == nil {
if empty && pls == nil {
//log.Println("no players")
continue
}