Skip to content

Commit

Permalink
Merge pull request #830 from openedx/iahmad/ENT-8858
Browse files Browse the repository at this point in the history
fix: Increased curation task timeout
  • Loading branch information
irfanuddinahmad authored May 10, 2024
2 parents 9737d21 + 85d2be9 commit 1e6f5cc
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@


CACHE_KEY = '{task_id}_{content_type}'
CACHE_TIMEOUT = 1200


def get_cache_key(task_id: str, content_type: str) -> str:
Expand Down Expand Up @@ -219,9 +220,21 @@ def generate_curation(query: str, catalog_name: str, task_id: str):
)

# Cache data for tweaking the filter
cache.set(get_cache_key(task_id=task_id, content_type='ocm_courses'), partially_filtered_ocm_courses)
cache.set(get_cache_key(task_id=task_id, content_type='exec_ed_courses'), partially_filtered_exec_ed_courses)
cache.set(get_cache_key(task_id=task_id, content_type='programs'), programs)
cache.set(
get_cache_key(task_id=task_id, content_type='ocm_courses'),
partially_filtered_ocm_courses,
CACHE_TIMEOUT
)
cache.set(
get_cache_key(task_id=task_id, content_type='exec_ed_courses'),
partially_filtered_exec_ed_courses,
CACHE_TIMEOUT
)
cache.set(
get_cache_key(task_id=task_id, content_type='programs'),
programs,
CACHE_TIMEOUT
)

# filter programs based on the filtered courses
filtered_programs = apply_programs_filter(filtered_ocm_courses + filtered_exec_ed_courses, programs)
Expand Down

0 comments on commit 1e6f5cc

Please sign in to comment.