f7694cd8 by 周伟奇

fix enqueque

1 parent 79d15292
......@@ -89,7 +89,6 @@ class Command(BaseCommand, LoggerMixin):
base64_data = base64.b64encode(f.read())
return {'imgBase64': base64_data.decode('utf-8')}
async def fetch_ocr_result(self, img_path):
async with aiohttp.ClientSession(
headers=self.ocr_header, connector=aiohttp.TCPConnector(ssl=False)
......
......@@ -186,12 +186,12 @@ class DocView(GenericView, DocHandler):
data_source=random.choice(['POS', 'EAPP', 'Econtract']),
upload_finish_time=timezone.now(),
)
rh.enqueue(doc.id)
enqueue_res = rh.enqueue(doc.id)
pdf_file = args.get('pdf_file')
save_dir_path = os.path.join(conf.DATA_DIR, str(doc.id))
save_file_path = os.path.join(save_dir_path, '{0}.pdf'.format(doc.id))
os.makedirs(save_dir_path, exist_ok=True)
file_write(pdf_file, save_file_path)
self.running_log.info('[mock doc upload success] [doc_id={0}]'.format(doc.id))
self.running_log.info('[mock doc upload success] [doc_id={0}] [enqueue_res={1}]'.format(doc.id, enqueue_res))
return response.ok()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!