14 lines
345 B
Python
14 lines
345 B
Python
import os
|
|
import subprocess
|
|
|
|
from app.celery import app
|
|
|
|
base = os.path.dirname(__file__)
|
|
|
|
|
|
@app.task(queue="encoding")
|
|
def import_documents(urls):
|
|
for url in urls:
|
|
url = url.strip()
|
|
if url and url.startswith('http'):
|
|
subprocess.call(['/srv/pandora/bin/python', os.path.join(base, 'add_website_as_pdf.py'), url])
|