Fix connections
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"files": [],
|
||||
"url": "http://10.10.8.79:7001/xmlrpc",
|
||||
"url": "http://10.10.8.79:7000/xmlrpc",
|
||||
"params": {
|
||||
"from": "tcp://kptsp_vb",
|
||||
"query_data": "<?xml version=\"1.0\" encoding=\"utf-8\"?><request><header parcel_id=\"990715ba919544a98f22cc7d3b0d9e8d\"/><getCatalog/></request>",
|
||||
|
||||
@@ -77,11 +77,12 @@ def pika_callback(ch, method, properties, body):
|
||||
files = []
|
||||
for file in data['files']:
|
||||
fn = os.path.join(gettempdir(), uuid4().hex)
|
||||
download_file(file['name'], file['bucket'], fn)
|
||||
files.append(fn)
|
||||
download_file(file['url']['name'], file['url']['bucket'], fn)
|
||||
file['url'] = fn
|
||||
files.append(file)
|
||||
run_task(params['query_type'], params, files, url)
|
||||
# except JSONDecodeError as e:
|
||||
# logging.warning(e)
|
||||
except JSONDecodeError as e:
|
||||
logging.warning(e)
|
||||
finally:
|
||||
ch.basic_ack(delivery_tag=method.delivery_tag)
|
||||
|
||||
@@ -92,7 +93,8 @@ def send_response(params, files, url):
|
||||
for file in files:
|
||||
fn = uuid4().hex
|
||||
upload_file(file['url'], fn, Config.s3_bucket)
|
||||
files_s3.append({'name': fn, 'bucket': Config.s3_bucket})
|
||||
file['url'] = {'name': fn, 'bucket': Config.s3_bucket}
|
||||
files_s3.append(file)
|
||||
data = {
|
||||
'params': params,
|
||||
'files': files_s3,
|
||||
|
||||
Reference in New Issue
Block a user