You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the documentation it states that the query cache is cleaned up, once in a while. However looking at the code it looks like it clears the entire cache every 1000 queries. This is due to the check in this line:
This method is behaving correctly - the first time a query is added to the cache, it has a hitCount of 0. Only if it's used again does it get a hitCount++, so that method is cleaning up things that are never re-used as is the intent :)
In the documentation it states that the query cache is cleaned up, once in a while. However looking at the code it looks like it clears the entire cache every 1000 queries. This is due to the check in this line:
https://github.com/StackExchange/Dapper/blob/d19d6012e75feebf24d591ad21b16f13becc95f2/Dapper/SqlMapper.cs#L78
COLLECT_HIT_COUNT_MIN is defined as:
https://github.com/StackExchange/Dapper/blob/d19d6012e75feebf24d591ad21b16f13becc95f2/Dapper/SqlMapper.cs#L91
Wouldn't that render the IF statement true every time, as hitcount always would be >= 0?
The text was updated successfully, but these errors were encountered: