...
|
...
|
@@ -130,7 +130,7 @@ class HomeModel |
|
|
}
|
|
|
$menu[] = $item;
|
|
|
}
|
|
|
Cache::set($key, $menu, 3600);
|
|
|
Cache::set($key, $menu, 1800);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -234,7 +234,7 @@ class HomeModel |
|
|
//格式化数据
|
|
|
$data = ChannelProcess::getFormat($channel, $resource['data']);
|
|
|
//设置master,slave
|
|
|
Cache::set($key, $data, 3600);
|
|
|
Cache::set($key, $data);
|
|
|
//清空变量
|
|
|
$resource = array();
|
|
|
}
|
...
|
...
|
@@ -333,7 +333,7 @@ class HomeModel |
|
|
$result[] = $val;
|
|
|
}
|
|
|
}
|
|
|
Cache::set($key, $result, 3600);
|
|
|
Cache::set($key, $result);
|
|
|
}
|
|
|
// 当一级缓存失效,并且接口异常时, 尝试从二级缓存获取数据
|
|
|
if (empty($result)) {
|
...
|
...
|
@@ -396,7 +396,7 @@ class HomeModel |
|
|
$val['num'] = $resources[$channel]['total'];
|
|
|
}
|
|
|
}
|
|
|
Cache::set($key, $list, 3600);
|
|
|
Cache::set($key, $list, 1800);
|
|
|
}
|
|
|
}
|
|
|
// 当一级缓存失效,并且接口异常时, 尝试从二级缓存获取数据
|
...
|
...
|
|