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

Clan cache warmup #520 #526

Merged
merged 10 commits into from Dec 6, 2023
Merged

Clan cache warmup #520 #526

merged 10 commits into from Dec 6, 2023

Conversation

beckpaul
Copy link
Collaborator

@beckpaul beckpaul commented Dec 6, 2023

Address #520 for the most part.

Criteria:

cache will be generated at server start/restart

  • Runs on start along with other jobs

will be scheduled to refresh it every (ttl - 1min), currently this would be 59min

  • TTL configured is 60 min in clanService - job runs every 59

should not run in parallel with other JavaApi calls if possible (ddos ourself if the list of crawlers getting bigger)

  • I believe mutex takes care of this here:
from src/backend/services/clanService.js

if (this.mutexService.locked) {
        await this.mutexService.acquire(() => {
        }, this.lockTimeout)
    return this.getAll()
}

should not crash the server if the JavaApi is not reachable or and exception is happening.

  • Exceptions are handled the same way as leaderboards with logging and catching

should log if a cache was getting refreshed or when something failed

  • Error handler and success handler print when caches updates/fails.

Copy link

codecov bot commented Dec 6, 2023

Codecov Report

Attention: 19 lines in your changes are missing coverage. Please review.

Comparison is base (e954663) 41.79% compared to head (049e528) 41.58%.

Files Patch % Lines
src/backend/cron-jobs/clanCacheCrawler.js 26.31% 14 Missing ⚠️
src/backend/cron-jobs/leaderboardCacheCrawler.js 0.00% 2 Missing ⚠️
src/backend/cron-jobs/wordpressCacheCrawler.js 33.33% 2 Missing ⚠️
src/backend/AppKernel.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #526      +/-   ##
===========================================
- Coverage    41.79%   41.58%   -0.22%     
===========================================
  Files           70       71       +1     
  Lines         1682     1705      +23     
  Branches       220      220              
===========================================
+ Hits           703      709       +6     
- Misses         947      964      +17     
  Partials        32       32              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Brutus5000
Copy link
Member

Please use proper PR names as they appear in the changelog

@Brutus5000 Brutus5000 changed the title Develop 520 Clan cache warmup #520 Dec 6, 2023
@fcaps
Copy link
Collaborator

fcaps commented Dec 6, 2023

you could use the names of the ticket aka "524-clan-transfer-ownership", there is even a create branch function in the ticket.

@beckpaul beckpaul closed this Dec 6, 2023
@beckpaul beckpaul reopened this Dec 6, 2023
@fcaps fcaps merged commit 0d21d36 into FAForever:develop Dec 6, 2023
3 of 5 checks passed
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.

None yet

3 participants