|  | @@ -9,16 +9,14 @@ import hashlib
 | 
											
												
													
														|  |  import urllib.parse
 |  |  import urllib.parse
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  from applications.log import logging
 |  |  from applications.log import logging
 | 
											
												
													
														|  | 
 |  | +from applications.const import server_const
 | 
											
												
													
														|  | 
 |  | +from applications.functions import forward_request
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  class Response(object):
 |  |  class Response(object):
 | 
											
												
													
														|  |      """
 |  |      """
 | 
											
												
													
														|  |      Response
 |  |      Response
 | 
											
												
													
														|  |      """
 |  |      """
 | 
											
												
													
														|  | -    REQUEST_INIT_STATUS = 0
 |  | 
 | 
											
												
													
														|  | -    REQUEST_SUCCESS_STATUS = 1
 |  | 
 | 
											
												
													
														|  | -    REQUEST_PROCESSING_TASK = 101
 |  | 
 | 
											
												
													
														|  | -    TASK_MAX_PROCESS_TIMES = 3
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      def __init__(self, params, mysql_client, config):
 |  |      def __init__(self, params, mysql_client, config):
 | 
											
												
													
														|  |          """
 |  |          """
 | 
											
										
											
												
													
														|  | @@ -327,4 +325,12 @@ class Response(object):
 | 
											
												
													
														|  |          if params_error:
 |  |          if params_error:
 | 
											
												
													
														|  |              return params_error
 |  |              return params_error
 | 
											
												
													
														|  |          else:
 |  |          else:
 | 
											
												
													
														|  | -            return await self.job()
 |  | 
 | 
											
												
													
														|  | 
 |  | +            trace_id_exist_flag = await self.check_trace_id()
 | 
											
												
													
														|  | 
 |  | +            if trace_id_exist_flag:
 | 
											
												
													
														|  | 
 |  | +                return await self.job()
 | 
											
												
													
														|  | 
 |  | +            else:
 | 
											
												
													
														|  | 
 |  | +                return {
 | 
											
												
													
														|  | 
 |  | +                    "traceId": self.trace_id,
 | 
											
												
													
														|  | 
 |  | +                    "code": 100,
 | 
											
												
													
														|  | 
 |  | +                    "message": "该 trace_id 不存在"
 | 
											
												
													
														|  | 
 |  | +                }
 |