def test(): runque = RedisQueueConnection('scan').conn size = runque.qsize() print size sleep(1) cnt = 0 if size: while cnt < size: i = runque.get() print i runque.put(i) cnt += 1 runque.flushdb() exit(0) f = open('seeds995k.txt') urls = f.read().strip().split('\n') if size == 0: i = 0 st = time() for url in urls: runque.put(url)
def run(): runque = RedisQueueConnection('running').conn #########runque.flushdb() size = runque.qsize() print size raw_input('flush runing') runque.flushdb()
def inserturls(): runque = RedisQueueConnection('extracturls').conn print runque.qsize() raw_input('flushdb?') runque.flushdb() urls = flist('urlstogetip.txt') for url in urls: runque.put(url) print runque.qsize()
def rmdb(test): runque = RedisQueueConnection(test).conn print runque.qsize() raw_input('yes?') runque.flushdb()