13 lines
342 B
Python
13 lines
342 B
Python
import os
|
|
import subprocess
|
|
|
|
from celery.task import task
|
|
|
|
base = os.path.dirname(__file__)
|
|
|
|
@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])
|