Skip to content

Commit

Permalink
Gracefully handle reserve task category for private instance
Browse files Browse the repository at this point in the history
  • Loading branch information
dchhabda committed Aug 18, 2022
1 parent ed2d3a8 commit ba02983
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pybossa/sched.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ def get_reserve_task_category_info(reserve_task_config, project_id, timeout, use
if not reserve_task_config:
return sql_filters, category_keys

if current_app.config.get('PRIVATE_INSTANCE'):
current_app.logger.info("Reserve task by category disabled for private instance. project_id %s, reserve_task_config %s",
project_id, str(reserve_task_config))
return sql_filters, category_keys

category = ":".join(["{}:*".format(field) for field in sorted(reserve_task_config)])
lock_manager = LockManager(sentinel.master, timeout)
category_keys = lock_manager.get_task_category_lock(project_id, user_id, category, exclude_user)
Expand Down

0 comments on commit ba02983

Please sign in to comment.