summaryrefslogtreecommitdiff
path: root/frameworks/middleware/examples/celery/exec_task.py
blob: 91692509edbe499a7025aec6556e0d20deaaa902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os

from celery import Celery

app = Celery ('tasks', broker='sqla+sqlite:///celerydb.sqlite',
                       backend='db+sqlite:///results.sqlite')

@app.task
def execute (command):
    return os.system (command)

@app.task
def execute2 (command):
    if os.system (command):
       raise Exception ("command not found")