View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0020551 | mantisbt | code cleanup | public | 2016-01-29 00:33 | 2016-08-28 01:12 |
Reporter | vboctor | Assigned To | atrol | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Product Version | 1.3.0-rc.1 | ||||
Target Version | 1.3.1 | Fixed in Version | 1.3.1 | ||
Summary | 0020551: Why does user_cache_database_result() return cache value? | ||||
Description | This method is called to put rows into the cache? Why does it check for the row in the cache and return it? I would have expected it to always update the row and not return it, just have a void return. Currently if the passed row is newer than the one in the cache, the cache will maintain the old one which is now stale. Probably not a huge deal since the request will be stale for this just single request, but it is not right. | ||||
Tags | No tags attached. | ||||
sometimes i think a more structured cache (not just random global vars) may be a benefit. |
|
I had a quick look, and it appears that user_cache_database_result() is only called after user_search_cache() failed to return anything, which implies that the cache is not set for the record being added. That being said, I don't see the rationale behind the function's current behavior either. |
|
I stumbled too often over this function and did not understand what it does. |
|
MantisBT: master-1.3.x 694873e7 2016-08-22 10:56 Details Diff |
Cache latest data in function user_cache_database_result The functions did not return a value in all cases. There is no place in code where the return value of the function is used. The cache was not updated with latest data if's been set before. Fixes 0020551 |
Affected Issues 0020551 |
|
mod - core/user_api.php | Diff File |