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

Use ReadOnly Session when indixing content items #15216

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

MikeAlhayek
Copy link
Member

@MikeAlhayek MikeAlhayek commented Jan 31, 2024

YeSql has a new way of creating session for readonly scenarios. Reducing the caching objects when doing read-only operation should reduce unwanted caching/allocation done by yessql internally.

This should be useful when fetching data for read only scenario.

@@ -81,6 +81,7 @@ public async Task ProcessContentItemsAsync(params string[] indexNames)
var tasks = new List<IndexingTask>();

var allContentTypes = indexSettings.SelectMany(x => x.IndexedContentTypes ?? []).Distinct().ToList();
var readOnlySession = _store.CreateSession(withTracking: false);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe session for simplicity

Copy link
Member Author

Choose a reason for hiding this comment

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

no. I purposely called it readOnlySession to indicate that it is a session for read only.

@MikeAlhayek MikeAlhayek merged commit 187b0e8 into main Feb 1, 2024
5 checks passed
@MikeAlhayek MikeAlhayek deleted the ma/readonly-session branch February 1, 2024 04:01
urbanit pushed a commit to urbanit/OrchardCore that referenced this pull request Mar 18, 2024
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