equal
deleted
inserted
replaced
51 | DeleteClient ClientIndex |
51 | DeleteClient ClientIndex |
52 | PingAll |
52 | PingAll |
53 | StatsAction |
53 | StatsAction |
54 | RestartServer Bool |
54 | RestartServer Bool |
55 |
55 |
|
56 |
56 type CmdHandler = [B.ByteString] -> Reader (ClientIndex, IRnC) [Action] |
57 type CmdHandler = [B.ByteString] -> Reader (ClientIndex, IRnC) [Action] |
57 |
58 |
58 instance NFData Action where |
59 instance NFData Action where |
59 rnf (AnswerClients chans msg) = chans `deepseq` msg `deepseq` () |
60 rnf (AnswerClients chans msg) = chans `deepseq` msg `deepseq` () |
60 rnf a = a `seq` () |
61 rnf a = a `seq` () |
410 (roomsNum, clientsNum) <- io $ withRoomsAndClients rnc st |
411 (roomsNum, clientsNum) <- io $ withRoomsAndClients rnc st |
411 io $ writeChan (dbQueries si) $ SendStats clientsNum (roomsNum - 1) |
412 io $ writeChan (dbQueries si) $ SendStats clientsNum (roomsNum - 1) |
412 where |
413 where |
413 st irnc = (length $ allRooms irnc, length $ allClients irnc) |
414 st irnc = (length $ allRooms irnc, length $ allClients irnc) |
414 |
415 |
415 processAction (RestartServer _) = |
416 processAction (RestartServer force) = do |
416 return () |
417 if force then do |
|
418 return () |
|
419 else |
|
420 processAction $ ModifyServerInfo (\s -> s{restartPending=True}) |