Add new scheme application

This commit is contained in:
Ivan Vazhenin
2023-11-27 20:37:53 +03:00
parent 92dd8162c5
commit 3841f50628
2 changed files with 7 additions and 3 deletions

View File

@@ -67,8 +67,8 @@ def get_branch(bndname: str, scheme: str):
with Session(conn) as session:
item = session.query(db.IncomeBranch).filter_by(scheme=scheme).join(db.User).filter_by(bndname=bndname).one_or_none()
if item:
return item.branch
return None
return item.branch,item.local_scheme
return None, None
def run_tasks():
@@ -570,7 +570,9 @@ def apply_commits(params, files, url):
repl = req.find('replication')
scheme = repl.get('scheme')
commit = repl.get('id')
branch = get_branch(params['from'].replace('tcp://', ''), scheme)
branch, new_scheme = get_branch(params['from'].replace('tcp://', ''), scheme)
if new_scheme:
scheme = new_scheme
if branch:
logging.warning(branch)
con = OOConnectionParams(scheme, Config.oodb_host, Config.oodb_port, Config.oodb_dbname,