/** * How much time the client must wait before it will be * allowed to try to log-in next. * The return value is 0 if no wait is required. */ private function getNextLoginTimeout() { global $wgMemc; $val = $wgMemc->get($this->getMemCacheKey()); $elapse = time() - $val['lastReqTime']; // in seconds $canRetryIn = ApiLogin::calculateDelay($val['count']) - $elapse; return $canRetryIn < 0 ? 0 : $canRetryIn; }