Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old courses from the cache #4061

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Remove old courses from the cache #4061

wants to merge 1 commit into from

Conversation

jcoyne
Copy link
Contributor

@jcoyne jcoyne commented Mar 1, 2024

Otherwise the cache will grow without bound

Holding until sul-dlss/searchworks_traject_indexer#1376 is resolved.

# So we'll post process instead.
get_json('/coursereserves/courses', params: { limit: 2_147_483_647 })
.fetch('courses', [])
.filter { |course| Time.parse(course.dig('courseListingObject', 'termObject', 'startDate')).future? } # rubocop:disable Rails/TimeZone
Copy link
Member

@cbeer cbeer Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this exclude the current term too (because it's start date is in the past)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I will change it to endDate

Otherwise the cache will grow without bound
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants