提交 13263e8965aacf8d0deff408f0adf09e217337e6

作者 nheweijun
1 个父辈 ec3d2c0b

2021.12.02 任务控制使用新方式修复bug

... ... @@ -24,7 +24,13 @@ class Api(ApiTemplate):
24 24 map_service_guid = uuid.uuid1().__str__()
25 25 service_function_guid = uuid.uuid1().__str__()
26 26
27   - #调用MapService服务发布接口
  27 +
  28 +
  29 + # 逻辑是,先调用引擎接口,引擎说可以,才做持久化
  30 +
  31 +
  32 +
  33 +
28 34
29 35 service = Service(
30 36 guid = service_guid,
... ... @@ -71,6 +77,7 @@ class Api(ApiTemplate):
71 77 # 调用MapService服务的注册服务接口
72 78 try:
73 79 pass
  80 + #对,逻辑是,先调用引擎接口,引擎说可以,才做持久化
74 81 except Exception as e:
75 82 db.session.delete(service)
76 83 db.session.delete(map_service)
... ...
... ... @@ -225,7 +225,7 @@ class MapService(db.Model):
225 225 '''
226 226 MapService元数据
227 227 '''
228   - __tablename__ = 'dmdms_map_service'
  228 + __tablename__ = 'dmap_map_service'
229 229
230 230 guid = Column(String(256), primary_key=True)
231 231 name = Column(String, unique=True)
... ...
... ... @@ -28,6 +28,8 @@ class Api(ApiTemplate):
28 28 tile_service_guid = uuid.uuid1().__str__()
29 29 service_function_guid = uuid.uuid1().__str__()
30 30
  31 + # 调用切片服务的注册服务接口
  32 + # 先调用切片服务接口,成功后才持久化
31 33
32 34 service = Service(
33 35 guid = service_guid,
... ...
... ... @@ -31,13 +31,13 @@ class TaskController:
31 31 #控制正在运行的任务数量
32 32 running_count = sys_session.query(Task).filter(Task.state == 2).filter(Task.task_type == 1).count()
33 33 first_task = sys_session.query(Task).filter(Task.state == 0).filter(Task.task_type == 1).order_by(Task.create_time).first()
34   - if (running_count > configure.entry_data_thread) or (not first_task.guid.__eq__(task_guid)):
  34 + if (running_count >= configure.entry_data_thread) or (not first_task.guid.__eq__(task_guid)):
35 35 StructurePrint().print("等待入库")
36 36 check = False
37 37 if task.task_type==2:
38 38 running_count = sys_session.query(Task).filter(Task.state == 2).filter(Task.task_type == 2).count()
39 39 first_task = sys_session.query(Task).filter(Task.state == 0).filter(Task.task_type == 2).order_by(Task.create_time).first()
40   - if (running_count > configure.entry_data_thread) or (not first_task.guid.__eq__(task_guid)):
  40 + if (running_count >= configure.entry_data_thread) or (not first_task.guid.__eq__(task_guid)):
41 41 StructurePrint().print("等待精化")
42 42 check = False
43 43 if task.task_type==3:
... ...
注册登录 后发表评论