From ecc622911eaba0b6c93c2a3964a49af9d208283e Mon Sep 17 00:00:00 2001 From: Lukas Schauer Date: Mon, 28 Dec 2020 19:24:18 +0100 Subject: Perfected prefambulation levels reached --- model/Schedule.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'model') diff --git a/model/Schedule.php b/model/Schedule.php index 5419136..e182132 100644 --- a/model/Schedule.php +++ b/model/Schedule.php @@ -72,7 +72,8 @@ class Schedule public function getSchedule() { - $cachefile = sprintf('/tmp/getschedule-cache-%s.cache', $this->getConference()->getSlug()); + $cachefile = sprintf('/dev/shm/getschedule-cache-%s.cache', $this->getConference()->getSlug()); + $tmpcachefile = sprintf('/dev/shm/getschedule-cache-%s.cache.new', $this->getConference()->getSlug()); if(file_exists($cachefile) && !$GLOBALS['regenschedcache']) { return unserialize(file_get_contents($cachefile)); } @@ -267,7 +268,8 @@ class Schedule } if($GLOBALS['regenschedcache']) { - file_put_contents($cachefile, serialize($program)); + file_put_contents($tmpcachefile, serialize($program)); + rename($tmpcachefile, $cachefile); } return $program; -- cgit v1.2.3