# Path: celeryapp/crawl_tasks.py
# def request(self, dict_item, **kwargs):
# def request_priority(self, dict_item, **kwargs):
# def parse(self, dict_item, **kwargs):
# def parse_priority(self, dict_item, **kwargs):
# def pipeline(self, dict_item, **kwargs):
# def schedule(self, tasks=None, check_task=False, save_filter=False):
# def crawl_synchronous(self, dict_item, **kwargs):
# 
# Path: celeryapp/celery.py
# def get_message_queue_size(queue_name):
#     client = redis.Redis(IP.findall(config.broker)[0])
#     length = client.llen(queue_name)
#     return length


import os
import sys
import config
import celeryconfig
import logging
import gevent
import json
import time
from celeryapp.crawl_tasks import app
from celeryapp.celery import get_message_queue_size
from celery import group
from gevent import monkey
from gevent.pool import Pool
from gevent.lock import Semaphore
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import absolute_import

current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.path.join(current_path, '..'))
sys.path.append(root_path)
# chagne work dir

# Path: celeryapp/crawl_tasks.py
# def request(self, dict_item, **kwargs):
# def request_priority(self, dict_item, **kwargs):
# def parse(self, dict_item, **kwargs):
# def parse_priority(self, dict_item, **kwargs):
# def pipeline(self, dict_item, **kwargs):
# def schedule(self, tasks=None, check_task=False, save_filter=False):
# def crawl_synchronous(self, dict_item, **kwargs):
# 
# Path: celeryapp/celery.py
# def get_message_queue_size(queue_name):
#     client = redis.Redis(IP.findall(config.broker)[0])
#     length = client.llen(queue_name)
#     return length


# Path: bin/run.py
import os
import sys
import config
import celeryconfig
import logging
import gevent
import json
import time
from celeryapp.crawl_tasks import app
from celeryapp.celery import get_message_queue_size
from celery import group
from gevent import monkey
from gevent.pool import Pool
from gevent.lock import Semaphore

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import absolute_import

current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.path.join(current_path, '..'))
sys.path.append(root_path)
# chagne work dir

os.chdir(root_path)