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

Add refresh listener to Org API #310

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

pwrightcertinia
Copy link
Contributor

@pwrightcertinia pwrightcertinia commented Dec 12, 2024

Adds a new Org API to set a sync listener for refresh, intended to be used in conjunction with some other mechanism e.g. RPC to post messages from server to client. Since it currently shares the same thread as flusher, it's not really suitable for "work".

Also identified two issues with indexer refreshing and cache flushing

  • When using the indexer to report file changes, a high priority refresh (i.e. a single file change) was not being respected and the end result was a batched refresh + cache flush (flusher.refreshAndFlush) in all cases.

    • This is because there are two Org.queueMetadataRefresh methods, one accepting an Iterable that was being used instead of the other intended one when requests.length = 1
  • When using autoFlush = true, a now fixed high priority refresh request (from above) would do the refresh step but now not flush to cache (until the next queued update / multi file change).

    • Instead of setting it to do this immediately again, set a flag for the flusher thread to pick up on its next check for dirty state. This way if other requests were queued while the thread is asleep, a flush would not happen unnecessarily.

@pwrightcertinia pwrightcertinia marked this pull request as ready for review December 14, 2024 15:48
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