def __init__(self, name): self.db = Connection(config.db_host, config.db_db, config.db_user, config.db_password) self.logger = fn.init_file_logger(name + '.log') self.urlpool = UrlPool(name) self.hub_hosts = None self.load_hubs()
def __init__(self, name): self._workers = 0 self._workers_max = 32 self.logger = fn.init_file_logger(name + ".log") self.urlpool = UrlPool(name) self.loop = asyncio.get_event_loop() self.session = aiohttp.ClientSession(loop=self.loop) self.db = SanicDB(config.db_host, config.db_name, config.db_username, config.db_password, loop=self.loop)
def __init__(self, name): self._workers = 0 self._workers_max = 5 self.logger = fn.init_file_logger(name + '.log') self.urlpool = UrlPool(name) self.loop = asyncio.get_event_loop() self.session = aiohttp.ClientSession(loop=self.loop) self.db = motor.motor_asyncio.AsyncIOMotorClient(config.MONGO_URI)["haodaifu"]
def __init__(self,name): self.db = MySqlHelper(config.Config.db_host,config.Config.db_db,config.Config.username,config.Config.password) self.logger = fn.init_file_logger(name + '.log') self.urlpool = UrlPool(name) self.hub_hosts = None self.load_hubs()