1
This commit is contained in:
parent
39aec1617b
commit
874a893c9c
@ -257,8 +257,7 @@ class DailySelectionController extends BaseAuthedController {
|
||||
|
||||
private function load()
|
||||
{
|
||||
$rawData = myself()->_getSelfRedis()->get(
|
||||
DAILY_SELECTION_KEY . myself()->_getAccountId());
|
||||
$rawData = myself()->_getSelfRedis()->get($this->getRedisKey());
|
||||
if (empty($rawData)) {
|
||||
$this->internalRefresh(false);
|
||||
$this->save();
|
||||
@ -272,12 +271,18 @@ class DailySelectionController extends BaseAuthedController {
|
||||
$remainSec = 3600 * 24 - (myself()->_getNowTime() - myself()->_getNowDaySeconds());
|
||||
$remainSec = max(0, $remainSec);
|
||||
myself()->_getSelfRedis()->set(
|
||||
DAILY_SELECTION_KEY . myself()->_getAccountId(),
|
||||
$this->getRedisKey(),
|
||||
json_encode($this->data)
|
||||
);
|
||||
myself()->_getSelfRedis()->pexpire(
|
||||
DAILY_SELECTION_KEY . myself()->_getAccountId(),
|
||||
$this->getRedisKey(),
|
||||
$remainSec * 1000);
|
||||
}
|
||||
|
||||
private function getRedisKey()
|
||||
{
|
||||
$key = DAILY_SELECTION_KEY . myself()->_getAccountId();
|
||||
return $key;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user