Skip to content

Commit

Permalink
归档任务执行时关闭schema_object创建的连接 fix hhyo#1155
Browse files Browse the repository at this point in the history
(cherry picked from commit 5fc6443)
  • Loading branch information
hhyo authored and nick2wang committed Nov 8, 2022
1 parent 0d88438 commit d694741
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sql/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,13 @@ def archive(archive_id):
dest_db_name = archive_info.dest_db_name
dest_table_name = archive_info.dest_table_name
# 目标表的字符集信息
d_engine = get_engine(d_ins)
d_db = d_engine.schema_object.databases[dest_db_name]
schema_object = get_engine(d_ins).schema_object
d_db = schema_object.databases[dest_db_name]
d_tb = d_db.tables[dest_table_name]
d_charset = d_tb.options["charset"].value
if d_charset is None:
d_charset = d_db.options["charset"].value
schema_object.connection.close()
# dest
dest = (
rf"h={d_ins.host},u={d_ins.user},p={d_ins.password},P={d_ins.port},"
Expand Down

0 comments on commit d694741

Please sign in to comment.