Add new scheme application
This commit is contained in:
8
main.py
8
main.py
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user