diff --git a/examples/catalog.json b/examples/catalog.json index 37d99a8..cb1bc6c 100644 --- a/examples/catalog.json +++ b/examples/catalog.json @@ -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": "
", diff --git a/request_itv/__main__.py b/request_itv/__main__.py index fad5d54..33bc1e2 100644 --- a/request_itv/__main__.py +++ b/request_itv/__main__.py @@ -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,