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 LazyCacheOptions and use Options Pattern #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Azaferany
Copy link

add a constructor dependency on IOptions options

base on #128

this.cacheProvider = new Lazy<ICacheProvider>(() => cacheProvider);
keyLocks = new int[_options.NumberOfKeyLocks];
DefaultCachePolicy.DefaultCacheDurationSeconds = _options.DefaultCacheDurationSeconds;

Choose a reason for hiding this comment

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

Minor Suggestion: Consider removing this redundant empty line for cleaner code presentation.

{
public int DefaultCacheDurationSeconds { get; set; } = 60 * 20;
public int NumberOfKeyLocks { get; set; } = Math.Max(Environment.ProcessorCount * 8, 32);

Choose a reason for hiding this comment

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

Minor Suggestion: Consider removing this redundant empty line for cleaner code presentation.

public int NumberOfKeyLocks { get; set; } = Math.Max(Environment.ProcessorCount * 8, 32);

}
}

Choose a reason for hiding this comment

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

Including an empty line at the end of a file ensures consistency in version control diffs.

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