mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Fix incorrect point if cache file is somehow damaged
https://xetown.com/questions/1736150
This commit is contained in:
parent
6f51d0da87
commit
6ce32b612f
1 changed files with 7 additions and 3 deletions
|
|
@ -48,7 +48,7 @@ class pointModel extends point
|
|||
if ($point !== null)
|
||||
{
|
||||
$exists = true;
|
||||
return $point;
|
||||
return parent::$_member_point_cache[$member_srl] = $point;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -57,8 +57,12 @@ class pointModel extends point
|
|||
$cache_filename = sprintf('%s/%d.cache.txt', $cache_path, $member_srl);
|
||||
if (!$from_db && file_exists($cache_filename))
|
||||
{
|
||||
$exists = true;
|
||||
return parent::$_member_point_cache[$member_srl] = intval(trim(Rhymix\Framework\Storage::read($cache_filename)));
|
||||
$point = trim(Rhymix\Framework\Storage::read($cache_filename));
|
||||
if ($point !== '')
|
||||
{
|
||||
$exists = true;
|
||||
return parent::$_member_point_cache[$member_srl] = intval($point);
|
||||
}
|
||||
}
|
||||
|
||||
// Get from the DB
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue