Skip to content

asynchroneaus forecast fetcher via schedule()#223

Merged
MaStr merged 5 commits intomainfrom
async-forecast-fetcher
Nov 10, 2025
Merged

asynchroneaus forecast fetcher via schedule()#223
MaStr merged 5 commits intomainfrom
async-forecast-fetcher

Conversation

@MaStr
Copy link
Owner

@MaStr MaStr commented Nov 5, 2025

Closes #77

MaStr added 2 commits November 5, 2025 15:07
This commit introduces internal scheduling to enable async. data refresh.

Data refresh can happens in the main loop during fetch_forecast or in the scheduled task.
Which comes first, it is holding a lock during refresh.
If a lock is already there, we are skipping the refresh_data part, because the relaxed_caching class should create a possible concurrency.
@MaStr MaStr added this to the 0.5.4 milestone Nov 5, 2025
@MaStr MaStr requested a review from Copilot November 5, 2025 14:09
@MaStr MaStr added the enhancement New feature or request label Nov 5, 2025
@MaStr MaStr self-assigned this Nov 5, 2025
@MaStr MaStr changed the title asynchroneaus forecast fetcher vie schedule() asynchroneaus forecast fetcher via schedule() Nov 5, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@MaStr
Copy link
Owner Author

MaStr commented Nov 5, 2025

This PR is running on my production environment for verification.

By now, I can tell, that a few requests are still processed in the main loop. The scheduling does work, but it happens that the refresh interval of the main-loop does fit better with the scheduled one.

In the scheduler, the same refresh_data is called and each provider needs to verify if it does a refresh or not.

Not sure, if that behavior is sufficient or not.

cc @johannesghd for a qualified comment

@MaStr MaStr merged commit 5b1387c into main Nov 10, 2025
10 checks passed
@MaStr MaStr deleted the async-forecast-fetcher branch November 10, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collect external data (price, solarforecast) asynchronous

2 participants