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

Disable archive.org queries after timeout #347

Merged
merged 3 commits into from
Oct 20, 2024

Conversation

HebaruSan
Copy link
Member

Problem

#346 tried to address the download counter's log spam and downtime by setting an instance variable when a timeout occurred and gating further queries with that variable. This was somewhat effective in that last night's count pass completed, but it still wasted time querying archive.org and spammed Discord.

Cause

After performing a batched query to archive.org, DownloadCounter replaces its InternetArchiveBatchedQuery object with a fresh one. Before #346, the timeout exception was preventing this from happening, so the same query object got stuffed with all mods over time, .full() was always True, and we tried to query archive.org for every mod (rather than once per 30), over and over, with an increasingly gigantic query.

The main thing from #346 that was helpful was catching the exception, which allowed the main loop to replace the query object, reducing the queries back to once per 30. But setting self.connect_timed_out then had no effect because the query object was discarded immediately afterwards.

Changes

  • Now the changes from Exclude internetarchive's internal logging from Discord #346 are removed, and instead the main DownloadCounter class itself catches the timeout exception from archive.org, discards its ia_query reference, and stops querying archive.org once this has happened.
  • GraphQLQuery is renamed GitHubBatchedQuery for consistency with the other classes
  • DownloadCounter.GITHUB_PATH_PATTERN is moved to GitHubBatchedQuery.PATH_PATTERN, and so on for the other path pattern variables

@HebaruSan HebaruSan added Bug Something isn't working Download counts It's about the download counts gathering mechanism labels Oct 20, 2024
@HebaruSan HebaruSan merged commit 1179585 into KSP-CKAN:master Oct 20, 2024
3 checks passed
@HebaruSan HebaruSan deleted the fix/disable-ia-dl-counts branch October 20, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Download counts It's about the download counts gathering mechanism
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant