 
 private extension RankingManager {
     func queryRank(liveId: String, page: Int, completion: @escaping (Int?) -> Void) {
-        guard let urlString = rankingUrlString(for: page),
-              let url = URL(string: urlString) else {
+        guard !isRequesting else {
+            // Previous request is still in progress, reject the query.
             completion(nil)
             return
         }
+        guard let urlString = rankingUrlString(for: page),
+              let url = URL(string: urlString)
+        else {
+            // Query reached to max page, quit to further requesting.
+            completion(nil)
+            isRequesting = false
+            return
+        }
+        isRequesting = true
         var request = URLRequest(url: url)
         request.headers = [commonUserAgentKey: commonUserAgentValue]
         AF.request(request)

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

final class RankingManager {}

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

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