def get_unfinsh_task(message_id): select_msg_sql = ''' select task_id, client_id, object_id, task_status_id, weight, domain_name, schedule_time, claimed_process from email_package ep where ep.task_status_id <> 3 and ep.object_id = %s ''' carrier_conn = mdb.get_mesher_conn() datas = mdb.exe_sql(carrier_conn, select_msg_sql % (message_id), False, True) width = [10] * 6 + [20] + [10] mytt.display(['t_id', 'cid', 'mid', 't_status','weight','domain','s_time','mesher'], datas, width)
def get_task_status(task_id): select_msg_sql = ''' select task_id, task_status_id, domain_name, schedule_time, claimed_process, successful_count, softbounce_count, unstart_count from email_package ep where ep.task_id = '%s' ''' carrier_conn = mdb.get_mesher_conn() datas = mdb.exe_sql(carrier_conn, select_msg_sql % (task_id), False, True) width = [10] * 3 + [20] + [10] * 4 mytt.display(['t_id','t_status','domain','s_time','mesher','succ','soft','unt'], datas, width)
def get_task_status(message_id): task_status_sql = ''' select task_id, task_type_id, service_id, client_id, object_id, task_status_id, schedule_time, claimed_process from task t where t.task_status_id <> 3 and t.object_id = %s ''' global_conn = mdb.get_global_conn() datas = mdb.exe_sql(global_conn, task_status_sql % (message_id), False, True) width = [10] * 6 + [20] + [10] mytt.display(['t_id', 't_type', 's_id', 'cid', 'mid', 't_status', 's_time', 'claimed'], datas, width)
def showBymessage(start_time, end_time, clients): show_sql = ''' select ep.client_id,ep.object_id,sum(ep.successful_count),sum(ep.softbounce_count),sum(ep.hardbounce_count),sum(ep.unstart_count) from email_package ep where ep.start_time > '%s' and ep.end_time < '%s' and ep.client_id in (%s) group by ep.object_id ''' try: carrier_conn = mdb.get_mesher_conn() data = mdb.exe_sql(carrier_conn, show_sql % (start_time, end_time, clients), False, True) head = ['cid', 'mid', 'success', 'soft', 'hard', 'unstart' ] width = [10] * 6 nt.display(head,data,width) except Exception,e: print e sys.exit()