| | |
| | | # 本机执行redis |
| | | __LOCAL_REQUEST = True |
| | | |
| | | __async_task_queue = queue.Queue(maxsize=4096) |
| | | __async_task_queue = queue.Queue(maxsize=10240) |
| | | |
| | | @classmethod |
| | | def exec(cls, method_name, key, lamada_method): |
| | | __start_time = time.time() |
| | | try: |
| | | return lamada_method() |
| | | finally: |
| | |
| | | results = cls.__batch__request(dataList) |
| | | last_upload_time = time.time() |
| | | dataList.clear() |
| | | # try: |
| | | # db = data[0] |
| | | # method_name = data[1] |
| | | # args = data[2] |
| | | # _redis = RedisManager(db).getRedisNoPool() |
| | | # method = getattr(RedisUtils, method_name) |
| | | # if type(args) == tuple: |
| | | # args = list(args) |
| | | # args.insert(0, _redis) |
| | | # args = tuple(args) |
| | | # result = method(*args) |
| | | # else: |
| | | # args = tuple([_redis, args]) |
| | | # result = method(*args) |
| | | # except Exception as e2: |
| | | # logging.exception(e2) |
| | | # logging.error(data) |
| | | except Exception as e1: |
| | | logging.exception(e1) |
| | | pass |