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

Remove the sync method for background job module. #2466

Merged
merged 2 commits into from
Dec 26, 2019

Conversation

maliming
Copy link
Member

@hikalkan
Copy link
Member

Background job is OK, but we shouldn't change the tenant store. Why? Let me explain;

First of all, IConnectionStringResolver.Resolve method is sync by its nature. We can not change it, unfortunately.

For RemoteTenantStore.cs;

  • When we use AsyncHelper inside the Resolve method, AsyncHelper is always called, in every request. But if we move AsyncHelper usage to the RemoteTenantStore (like my implementation), it is called only if it can not find the connection string in the cache.

For TenantStore.cs;

  • If we remove the sync Find method, we force to AsyncHelper usage unnecessarily while we could implement it truely sync. Native sync is better than async over sync usage.

So, please cancel the tenantstore changes for now, until we find a good way to make IConnectionStringResolver.Resolve async.

@hikalkan hikalkan self-requested a review December 26, 2019 05:42
@maliming maliming changed the title Remove the sync method for tenant & background job module. Remove the sync method for background job module. Dec 26, 2019
@maliming
Copy link
Member Author

I have cancelled related changes to tenant.

@hikalkan hikalkan merged commit ae0abe3 into dev Dec 26, 2019
@hikalkan
Copy link
Member

Thanks ;)

@hikalkan hikalkan added this to the 2.0 milestone Dec 26, 2019
@maliming maliming deleted the maliming/remove-sync-method branch December 26, 2019 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants