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
Wrong absolute expiration is used #31
Comments
I can confirm this is happening to me on two of my three developer machines using this Cache.Insert signature taking these four parameters (System.Web.Caching.Cache). What framework update did this go out with? The code in question hasn't been touched in years and in passing in DateTime.Now + two hours. We change it the DateTime.UtcNow and it works again OR if we manually add 9 hours to our DateTime.Now calc (7 for UTC).... On several other developer machines this hasn't happened yet and on zero servers.... Figure it's an update to the framework via Visual studio update perhaps? |
This appears to have been in the framework for a long time as is..... Not sure why it's now manifesting on some machines here and not others with the code we wrote for cache.insert not being changed itself since 2015..... Must be something interrelated with a machine change.... |
This is not the right repository to file issues about the bug, the referencesource repo is read-only. @terrajobst can you please advise about where such issues should be filed? |
I suggest you file the issue in aspnet/home repository. We only track reference source infrastructure issues here. |
The utcAbsoluteExpiration variable is not used in the method overloading on line 422.
///
/// Inserts an object into the System.Web.Caching.Cache that has file or key dependencies and
/// expires at the value set in the parameter.
///
public void Insert(string key, object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration) {
DateTime utcAbsoluteExpiration = DateTimeUtil.ConvertToUniversalTime(absoluteExpiration);
ObjectCache.Insert(key, value, new CacheInsertOptions() {
Dependencies = dependencies,
AbsoluteExpiration = absoluteExpiration,
SlidingExpiration = slidingExpiration
});
}
The text was updated successfully, but these errors were encountered: