Skip to content

Commit d724cc3

Browse files
committed
Add Demo Fixtures to Run Every 30 Minutes
1 parent 99a7f2f commit d724cc3

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

config/celery_app.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
# run every 30 minutes to make sure all the ml-services are running
1515
"schedule": 30 * MINUTES_INTERVAL,
1616
},
17-
"test-heartbeat-errors": {
18-
"task": "open.core.tasks.test_heartbeat_errors",
19-
# run every 30 minutes to make sure all the ml-services are running
20-
"schedule": 10 * MINUTES_INTERVAL,
17+
"reset-betterself-demo-fixtures": {
18+
"task": "open.core.tasks.reset_betterself_demo_fixtures",
19+
"schedule": 30 * MINUTES_INTERVAL,
2120
},
2221
}
2322

open/core/tasks.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,13 @@ def check_services_running():
4040

4141

4242
@app.task(serializer="json")
43-
def test_heartbeat_errors():
44-
raise ValueError("Heartbeat Test Error")
43+
def reset_betterself_demo_fixtures():
44+
from open.users.models import User
45+
46+
from open.core.betterself.constants import DEMO_TESTING_ACCOUNT
47+
from open.core.betterself.utilities.demo_user_factory_fixtures import (
48+
create_demo_fixtures_for_user,
49+
)
50+
51+
user = User.objects.get(username=DEMO_TESTING_ACCOUNT)
52+
create_demo_fixtures_for_user(user)

0 commit comments

Comments
 (0)