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