def Foreman(job): # 資料庫連線 db = db_conn.MySQL() # 設定參數 FK_CONFIGS = FK_Foreman.readConfig(db) FK_Foreman.throwGrabWork(db , FK_CONFIGS["fetch.depth"]) return True
def __init__(self, fetcher): self.gearman_client = gearman.client.GearmanClient(["127.0.0.1"]) self.db = db_conn.MySQL() self.fetcher = fetcher self.url_pool = [] self.config = FK_Foreman.readConfig(self.db) self.type_name = ["群組", "粉絲"]