Skip to content

feat(lxlweb): make library fetching more robust; warm up caches on startup - #1650

Merged
andersju merged 2 commits into
developfrom
feat/more-robust-library-fetch
Jul 31, 2026
Merged

feat(lxlweb): make library fetching more robust; warm up caches on startup#1650
andersju merged 2 commits into
developfrom
feat/more-robust-library-fetch

Conversation

@andersju

Copy link
Copy Markdown
Member

Previously, if startRefreshLibraries failed (for example, because the EMM API was unavailable), lxlweb would run with no library/org data for at least 12 hours (until a regularly scheduled refresh succeeded).

This PR does a couple things:

  • Loading/caching of libraries/orgs/util is done immediately at start-up instead of when the first request comes in (but it deliberately still doesn't block any requests if loading hasn't finished).
  • If the initial refreshLibraries fails, it keeps trying every 30 seconds instead of waiting for 12 hours. Only after a successful fetch does it schedule the 12-hour refresh interval.

Related to #1649

@johanbissemattsson johanbissemattsson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

A slightly more SvelteKit_ish_ way would be using an init hook but it should be no different than writing the initialisation logic at the top level of the module.

@andersju

Copy link
Copy Markdown
Member Author

LGTM!

A slightly more SvelteKit_ish_ way would be using an init hook but it should be no different than writing the initialisation logic at the top level of the module.

Good point! I adjusted it a bit.

@johanbissemattsson johanbissemattsson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🙌

@andersju
andersju merged commit 625962e into develop Jul 31, 2026
2 checks passed
@andersju
andersju deleted the feat/more-robust-library-fetch branch July 31, 2026 11:33
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