def get_task_list(self): """ 获取任务列表 :return: """ pattern = "%s_%s_pagoda_[0-9]*" % (self.task_code, self.relId) result = BusinessUtil.get_redis_name_by_keys(pattern) self.logger.info("【数据提取】读取到的任务列表为:%s" % result) return result
def get_task_list(self): """ 获取数据列表 (例:201905241427196394251011058_1_pagoda_1,201905241427196394251011058_2_pagoda_2) :return: """ def sort_key(key): taskCode, server_index, name, index = key.split("_") return index current_pattern = "%s_%s_pagoda_[0-9]*" % (self.task_code, self.relId) other_pattern = "%s_[^%s]*_pagoda_[0-9]*" % (self.task_code, self.relId) current_list = BusinessUtil.get_redis_name_by_keys(current_pattern) other_list = BusinessUtil.get_redis_name_by_keys(other_pattern) """排序""" current_list.sort(key=sort_key) other_list.sort(key=sort_key) """数组合并""" result = current_list + other_list return result