Exemple #1
0
app = Celery('etl.tasks', broker=broker)

app.conf.CELERY_QUEUES = [
    Queue('tasks',
          Exchange('tasks'),
          routing_key='tasks',
          queue_arguments={'x-max-priority': 10})
]

app.conf.CELERYD_MAX_TASKS_PER_CHILD = 1
app.conf.CELERYD_PREFETCH_MULTIPLIER = 1
app.conf.CELERY_ACKS_LATE = True

etl_delete = Delete()
etl_web = Connector_Web()
etl_rss = Connector_RSS()

#
# Delete document with URI from index
#


@app.task(name='etl.delete')
def delete(uri):
    etl_delete.delete(uri=uri)


#
# Index a file
#
from etl import ETL
from etl_delete import Delete
from etl_file import Connector_File
from etl_web import Connector_Web
from etl_rss import Connector_RSS


verbose = True
quiet = False

app = Celery('etl.tasks')
app.conf.CELERYD_MAX_TASKS_PER_CHILD = 1

etl_delete = Delete()
etl_web = Connector_Web()
etl_rss = Connector_RSS()


#
# Delete document with URI from index
#

@app.task(name='etl.delete')
def delete(uri):
	etl_delete.delete(uri=uri)


#
# Index a file
#