提交 045a37069f613b41f98a8ba20a6a0317c7898566

作者 nheweijun
1 个父辈 78763c77

2022.02.22 修复抽稀

... ... @@ -80,7 +80,7 @@ class Api(ApiTemplate):
80 80 rename_sql = 'alter table "{}" rename to "{}"'.format(this_table.name,name)
81 81 sys_session.execute(rename_sql)
82 82 sys_session.commit()
83   - print(rename_sql)
  83 +
84 84 # 更新所有相关业务表
85 85 same_databases = Database.query.filter_by(sqlalchemy_uri=this_table.relate_database.sqlalchemy_uri).all()
86 86 same_databases_database_guid = [d.guid for d in same_databases]
... ...
... ... @@ -14,6 +14,7 @@ class Api(ApiTemplate):
14 14 api_name = "表信息"
15 15 def process(self):
16 16 res = {}
  17 + pg_ds = None
17 18 try:
18 19 table_guid = self.para.get("guid")
19 20 table = Table.query.filter_by(guid=table_guid).one_or_none()
... ... @@ -48,6 +49,9 @@ class Api(ApiTemplate):
48 49
49 50 except Exception as e:
50 51 raise e
  52 + finally:
  53 + if pg_ds:
  54 + pg_ds.Destroy()
51 55 return res
52 56
53 57 api_doc={
... ...
... ... @@ -58,10 +58,11 @@ class Api(ApiTemplate):
58 58 if pg_ds:
59 59 pg_ds.Destroy()
60 60
61   - if Task.query.filter_by(table_guid=table_guid,state=0).one_or_none():
  61 + if Task.query.filter_by(table_guid=table_guid,state=0).one_or_none() or table.is_vacuate==2:
62 62 res["result"] = False
63 63 res["msg"] = "矢量金字塔构建中!"
64 64 return res
  65 +
65 66 if table.table_type==0:
66 67 res["result"] = False
67 68 res["msg"] = "非空间表!"
... ...
... ... @@ -64,11 +64,13 @@ class Api(ApiTemplate):
64 64 res["result"] = False
65 65 res["msg"] = "矢量金字塔构建中!"
66 66 return res
67   - if table.table_type==0:
  67 +
  68 + if Task.query.filter_by(table_guid=table_guid,state=0).one_or_none() or table.is_vacuate==2:
68 69 res["result"] = False
69   - res["msg"] = "非空间表!"
  70 + res["msg"] = "矢量金字塔构建中!"
70 71 return res
71 72
  73 +
72 74 # 初始化task
73 75 task_guid = uuid.uuid1().__str__()
74 76
... ...
... ... @@ -11,7 +11,7 @@ VACUATE_DB_URI = None
11 11 #VACUATE_DB_URI = SQLALCHEMY_DATABASE_URI
12 12
13 13 #DMap引擎
14   -dmap_engine = "http://172.26.99.160:8820"
  14 +dmap_engine = "http://172.26.60.101:8820"
15 15
16 16 # 固定配置不需要修改
17 17
... ...
注册登录 后发表评论