Skip to content

Reduce API calls by fetching all jobs in single request #127

Draft
khsrali wants to merge 2 commits intoaiidateam:mainfrom
khsrali:less_frequent_api_calls_scheduler
Draft

Reduce API calls by fetching all jobs in single request #127
khsrali wants to merge 2 commits intoaiidateam:mainfrom
khsrali:less_frequent_api_calls_scheduler

Conversation

@khsrali
Copy link
Copy Markdown
Collaborator

@khsrali khsrali commented Jan 16, 2026

Instead of making individual API requests per job ID, now fetch all jobs
in a single request and filter locally. This reduces the number of API
calls to the FirecREST server.

Also improves the retry logic:

  • Reduce retry attempts from 5 to 3 with 0.5s sleep between attempts
  • Add warning logs when jobs are not found after retries

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 77.77778% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.19%. Comparing base (f000725) to head (9d1e78a).

Files with missing lines Patch % Lines
aiida_firecrest/scheduler.py 77.77% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
+ Coverage   82.03%   82.19%   +0.16%     
==========================================
  Files           4        4              
  Lines         846      848       +2     
==========================================
+ Hits          694      697       +3     
+ Misses        152      151       -1     
Flag Coverage Δ
pytests 82.19% <77.77%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@khsrali
Copy link
Copy Markdown
Collaborator Author

khsrali commented Jan 23, 2026

Update:
This has to wait, right now firecrest returns all jobs since 7 days ago. And frequent calling on /compute/jobs can introduce yet another overhead.

@khsrali khsrali marked this pull request as draft January 23, 2026 10:39
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.

1 participant