<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/hotwater.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/hotwater.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/lib/ical.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/ical.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/redis.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/redis.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/lib/switchbot.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/switchbot.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<workItem from="1665644884295" duration="20000" />
<workItem from="1665655356996" duration="39000" />
<workItem from="1665922708761" duration="719000" />
- <workItem from="1666248330245" duration="384000" />
- </task>
- <task id="LOCAL-00485" summary=".">
- <created>1621493667425</created>
- <option name="number" value="00485" />
- <option name="presentableId" value="LOCAL-00485" />
- <option name="project" value="LOCAL" />
- <updated>1621493667425</updated>
+ <workItem from="1666248330245" duration="464000" />
+ <workItem from="1666784917537" duration="1072000" />
</task>
<task id="LOCAL-00486" summary=".">
<created>1621494387501</created>
<option name="project" value="LOCAL" />
<updated>1665953404594</updated>
</task>
- <option name="localTasksCounter" value="534" />
+ <task id="LOCAL-00534" summary=".">
+ <created>1666248746111</created>
+ <option name="number" value="00534" />
+ <option name="presentableId" value="LOCAL-00534" />
+ <option name="project" value="LOCAL" />
+ <updated>1666248746111</updated>
+ </task>
+ <option name="localTasksCounter" value="535" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
* @param $closure Closure
* @return mixed
*/
-function remember($key, $ttl, $closure)
+function remember($key, $ttl, $closure, $default = null)
{
+ $rememberSaveKey = $key . '_save_remember';
$client = getRedisClient();
if (!$client->exists($key)) {
- $data = call_user_func($closure);
+ try {
+ $data = call_user_func($closure);
+ } catch (Exception $e) {
+ $data = getState($rememberSaveKey, $default);
+ }
$client->set($key, $data);
$client->expire($key, $ttl);
} else {
$data = $client->get($key);
}
+ setState($rememberSaveKey, $data);
return $data;
}