Rework and improve the scheduling of the server lag check
Previously the server lag check was run by update_clock() if the number of seconds since client startup was a multiple of 20 (unless it had already been done this second). This meant that if update_clock() was not being called frequently (eg. if your IRC connection was very quiet), it might go a long time between lag checks. This commit adds a /set LAG_CHECK_INTERVAL (defaulting to 30). For each server, a lag check ping is scheduled for every LAG_CHECK_INTERVAL seconds after the connection is finalised/registered. Setting this value to 0 disables the lag check pings entirely. The old code set the lag to 'unknown' immediately after sending out a ping, which meant that it was quite unpredictable how long the lag value would stay around for. The new code only sets this once the current lag value has become stale (ie. a ping reply is overdue based on the current lag value). If your lag is staying the same or reducing, you shouldn't see the [Lag ??] at all.
This commit is contained in:
Reference in New Issue
Block a user