def operation_end(cls, crawler, run_id): conn.set(make_key(crawler, "last_run"), pack_now(), ex=REDIS_LONG) pending = conn.decr(make_key(crawler, "run", run_id)) if unpack_int(pending) == 0: conn.set(make_key(crawler, "run", run_id, "end"), pack_now(), ex=REDIS_LONG)
def decr_pending(cls, crawler): conn.decr(make_key('queue_pending', crawler))