Fix connections

This commit is contained in:
ashatora
2024-05-01 13:09:36 +03:00
parent 18be337d34
commit e698b19b82

View File

@@ -218,11 +218,7 @@ def send_object_replication(bndname, ws, ids):
response_files = [{'name': os.path.basename(filepath), 'url': filepath, 'size': os.path.getsize(filepath)}]
logger.warning(response_files)
logging.debug('Send replication package')
proxy = ServerProxy(Config.enserver)
try:
proxy.send(params, response_files, Config.ret_path)
except:
logger.error('Error sending')
send_response(params, response_files, Config.ret_path)
def replication_old(bnd_name: str, commit_id: str, schema: str):
@@ -323,11 +319,7 @@ def replication(bnd_name: str, commit_id: str, schema: str):
response_files = [{'name': os.path.basename(filepath), 'url': filepath, 'size': os.path.getsize(filepath)}]
logger.warning(response_files)
logging.debug('Send replication package')
proxy = ServerProxy(Config.enserver)
try:
proxy.send(response_params, response_files, Config.ret_path)
except:
logger.error('Error sending')
send_response(response_params, response_files, Config.ret_path)
def pika_callback(ch, method, properties, body):
@@ -384,8 +376,8 @@ def send_response(params, files, url):
files_s3 = []
for file in files:
fn = uuid4().hex
upload_file(file['url'], fn, Config.s3_bucket)
file['url'] = {'name': fn, 'bucket': Config.s3_bucket}
upload_file(file['url'], fn, Config.s3_bucket_itv)
file['url'] = {'name': fn, 'bucket': Config.s3_bucket_itv}
files_s3.append(file)
data = {
'params': params,