Skip to content

Commit 483c703

Browse files
committed
Bots will do 10 random actions
1 parent d482f57 commit 483c703

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

backend/PyMatcha/utils/tasks.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def setup_periodic_tasks(sender, **kwargs):
3030
sender.add_periodic_task(
3131
600, calc_search_min_max.s(), name="Update Minimum and Maximum scores and ages for search every 10 minutes"
3232
)
33-
# sender.add_periodic_task(30, random_bot_action.s(), name="200 random bots actions")
33+
sender.add_periodic_task(10, random_bot_action.s(), name="Bots will do random actions")
3434

3535

3636
@celery.task
@@ -148,9 +148,6 @@ def take_random_users_online():
148148

149149
@celery.task
150150
def random_bot_action():
151-
for user in User.select_random(200):
152-
if not user.is_online and not user.is_bot:
153-
continue
154-
else:
155-
decide_bot_action(user)
156-
return "200 bots done actions"
151+
for user in User.select_random_multis(10, is_bot=True, is_online=True):
152+
decide_bot_action(user)
153+
return "Done 10 random actions"

0 commit comments

Comments
 (0)