Update celery_worker.py
Browse files- celery_worker.py +7 -3
celery_worker.py
CHANGED
|
@@ -1,11 +1,15 @@
|
|
| 1 |
from celery import Celery
|
| 2 |
-
from agents.strategy_agent import
|
| 3 |
-
from memory.database import log_action
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
app = Celery("autoexec_ai", broker="redis://localhost:6379/0")
|
| 6 |
|
| 7 |
@app.task
|
| 8 |
def scheduled_loop():
|
| 9 |
-
|
|
|
|
| 10 |
log_action("StrategyAgent", "scheduled_run", result)
|
| 11 |
return result
|
|
|
|
| 1 |
from celery import Celery
|
| 2 |
+
from agents.strategy_agent import StrategyAgent
|
| 3 |
+
from memory.database import init_db, log_action
|
| 4 |
+
|
| 5 |
+
# Initialize DB on startup
|
| 6 |
+
init_db()
|
| 7 |
|
| 8 |
app = Celery("autoexec_ai", broker="redis://localhost:6379/0")
|
| 9 |
|
| 10 |
@app.task
|
| 11 |
def scheduled_loop():
|
| 12 |
+
sa = StrategyAgent()
|
| 13 |
+
result = sa.generate("fitness", "dropshipping")
|
| 14 |
log_action("StrategyAgent", "scheduled_run", result)
|
| 15 |
return result
|