                 case .failure(let error):
                     log.error(error)
                     completion(nil)
+                    self?.isRequesting = false
                 }
             }
     }

                case .success(let html):
                    if let rank = self?.extractRank(from: html, liveId: liveId) {
                        completion(rank)
                    } else {
                        // Continue fetching further page recursively.
                        self?.queryRank(
                            liveId: liveId,
                            page: page + 1,

private let chikuranUrl = "http://www.chikuwachan.com/live/"
private let maxPage = 5

final class RankingManager {
    private var isRequesting = false
}

extension RankingManager: RankingManagerType {
    func queryRank(liveId: String, completion: @escaping (Int?) -> Void) {
