summaryrefslogtreecommitdiff
path: root/app/tasks.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/tasks.py')
-rw-r--r--app/tasks.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/tasks.py b/app/tasks.py
new file mode 100644
index 0000000..bba3fae
--- /dev/null
+++ b/app/tasks.py
@@ -0,0 +1,17 @@
+from celery import Celery
+
+from utils import restricted_exec
+
+app = Celery(
+ 'tasks',
+ broker='redis://localhost:6379/0',
+ backend='redis://localhost:6379/0',
+ task_send_sent_event=True,
+ worker_send_task_events=True,
+ worker_enable_remote_control=True,
+)
+
+
+@app.task
+def restricted_exec_task(code: str):
+ return restricted_exec.getoutput(code)