Commit bedeb54e by 陈森彬

只需要digikey的token

parent 1105c7cc
Showing with 13 additions and 14 deletions
......@@ -13,8 +13,8 @@ import lib
import token_lib
from log_manage import get_logger
# 去掉digikey,mouser的爬虫token
process_list = ['digikey',"mouser"]
# 需要的爬虫token
process_list = ['apidigikey']
logger = get_logger('app')
......@@ -55,18 +55,17 @@ def init_task(queue):
if issubclass(cls[1], token_lib.BaseTokenCrawler):
platform = getattr(module, "PLATFORM")
if platform in process_list:
continue
level = getattr(module, "LEVEL", DEFAULT_INTERVAL)
main_num = getattr(module, "MAIN_NUM", -1)
back_num = getattr(module, "BACK_NUM", -1)
mode = getattr(module, "MODE", "redis")
thread_num = getattr(module, "THREAD_NUM", 5)
obj = cls[1](platform, level, main_num, logger, back_num, mode, thread_num)
cur_stamp = time.time()
queue.put((cur_stamp, obj, True))
logger.info("Adding platform:%s, level=%s, main_num=%s, back_num=%s, mode=%s, thread_num=%s",
platform, level, main_num, back_num, mode, thread_num)
level = getattr(module, "LEVEL", DEFAULT_INTERVAL)
main_num = getattr(module, "MAIN_NUM", -1)
back_num = getattr(module, "BACK_NUM", -1)
mode = getattr(module, "MODE", "redis")
thread_num = getattr(module, "THREAD_NUM", 5)
obj = cls[1](platform, level, main_num, logger, back_num, mode, thread_num)
cur_stamp = time.time()
queue.put((cur_stamp, obj, True))
logger.info("Adding platform:%s, level=%s, main_num=%s, back_num=%s, mode=%s, thread_num=%s",
platform, level, main_num, back_num, mode, thread_num)
class Worker(Thread):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment