Skip to content

Commit

Permalink
Cache n_available_tasks_for_user for 5 mins
Browse files Browse the repository at this point in the history
  • Loading branch information
dchhabda committed Sep 8, 2022
1 parent e8ae50c commit 8e41523
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pybossa/cache/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from flask import current_app
from sqlalchemy.sql import text
from pybossa.core import db
from pybossa.cache import memoize, HALF_HOUR
from pybossa.cache import memoize, FIVE_MINUTES
from pybossa.model.project_stats import ProjectStats
from pybossa.cache import users as cached_users
from pybossa.cache import task_browse_helpers as cached_task_browse_helpers
Expand Down Expand Up @@ -171,7 +171,7 @@ def _has_no_tasks(project_id):
return n_tasks == 0


@memoize(timeout=HALF_HOUR)
@memoize(timeout=FIVE_MINUTES)
def n_available_tasks_for_user(project, user_id=None, user_ip=None):
"""Return the number of tasks for a given project a user can contribute to.
based on the completion of the project tasks, previous task_runs
Expand Down

0 comments on commit 8e41523

Please sign in to comment.