Example #1
0
	def insertTaskLog(self,chainCode):
		execSql = r'''
			insert into ''' + DB_SCHEAM +r'''.SPIDER_TASK_LOG_TB values('{TASK_CHAIN_CODE}','progress','{UPDATE_TIME}','')
		'''
		currentDate = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())

		return DataConn.execute(execSql, TASK_CHAIN_CODE=chainCode,UPDATE_TIME=currentDate);
Example #2
0
	def updateTaskLog(self,chainCode,status,reason):
		execSql = r'''
			update ''' + DB_SCHEAM +r'''.SPIDER_TASK_LOG_TB set EXEC_STATUS = '{EXEC_STATUS}',
			UPDATE_TIME = '{UPDATE_TIME}',TASK_REASON='{TASK_REASON}'
			where TASK_CHAIN_CODE = '{TASK_CHAIN_CODE}'
		'''
		currentDate = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())

		return DataConn.execute(execSql, TASK_CHAIN_CODE=chainCode,EXEC_STATUS=status,UPDATE_TIME=currentDate,TASK_REASON=reason);