

def _mini_purge(self, spiderid, appid, crawlid):
    '\n        Actually purges the crawlid from the queue\n\n        @param spiderid: the spider id\n        @param appid: the app id\n        @param crawlid: the crawl id\n        @return: The number of requests purged\n        '
    total_purged = 0
    match_string = '{sid}:*:queue'.format(sid=spiderid)
    for key in self.redis_conn.scan_iter(match=match_string):
        for item in self.redis_conn.zscan_iter(key):
            item_key = item[0]
            item = pickle.loads(item_key)
            if ('meta' in item):
                item = item['meta']
            if ((item['appid'] == appid) and (item['crawlid'] == crawlid)):
                self.redis_conn.zrem(key, item_key)
                total_purged = (total_purged + 1)
    return total_purged

dataset/ETHPy150Open istresearch/scrapy-cluster/redis-monitor/plugins/stop_monitor.py StopMonitor._mini_purge/original