def save_build_log(tq_id,tq_done=False): file_name="ci_build_log"+tq_id+".log" build_log=RedisService.get_value("ci_build_log"+tq_id) result=MongoDBService.save_content_asfile(file_name, build_log,BuildLogMongoFile) file_id=FileInfoService.add_file(0,result,file_name,1,0,len(build_log)) RedisService.delete_value("ci_build_log" + tq_id) if tq_done: temp_output = CITaskStepOutput() temp_output.ProductType = 1 temp_output.ProductID = file_id task_queue = TaskQueue.objects.get(int(tq_id)) task_history = CITaskHistory.objects.get_history_by_uuid(task_queue.TaskUUID) temp_output.TaskHistoryID = task_history.id temp_output.TaskID = task_history.CITaskID temp_output.StepID = "" temp_output.StageHistoryID = 0 temp_output.save() else: RedisService.set_value("ci_build_log"+tq_id,"") return file_id
def cache_issue_search_word(key, value): if RedisService.has_key(key): RedisService.delete_value(key) RedisService.set_value(key, value, 1800) else: RedisService.set_value(key, value, 1800)