From d96cd82652c6514ec6b45815e33922a503081ef3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 20 Feb 2019 22:16:55 +0100 Subject: [locationinfo] Don't refresh calendars indefinitely We try to refresh calendars that have recently been used to coalesce requests, which helps especially with HisInOne. However, this would in turn make the calendar recently refreshed so it would keep going on and on, as long as there is at least one active info panel making actual requests. --- modules-available/locationinfo/install.inc.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules-available/locationinfo/install.inc.php') diff --git a/modules-available/locationinfo/install.inc.php b/modules-available/locationinfo/install.inc.php index bbba3741..3a27d696 100644 --- a/modules-available/locationinfo/install.inc.php +++ b/modules-available/locationinfo/install.inc.php @@ -9,6 +9,7 @@ $t1 = $res[] = tableCreate('locationinfo_locationconfig', ' `openingtime` BLOB, `calendar` BLOB, `lastcalendarupdate` INT(10) UNSIGNED NOT NULL DEFAULT 0, + `lastuse` INT(10) UNSIGNED NOT NULL DEFAULT 0, `lastchange` int(10) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`locationid`) '); @@ -79,6 +80,15 @@ if ($t3 === UPDATE_NOOP) { // 2017-07-26 Add servername key Database::exec("ALTER TABLE `locationinfo_coursebackend` ADD KEY `servername` (`servername`)"); +// 2019-02-20 Add lastuse column +if (!tableHasColumn('locationinfo_locationconfig', 'lastuse')) { + if (Database::exec("ALTER TABLE locationinfo_locationconfig + ADD `lastuse` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `lastcalendarupdate`") === false) { + finalResponse(UPDATE_FAILED, 'Could not add lastuse column'); + } + $res[] = UPDATE_DONE; +} + // Create response for browser if (in_array(UPDATE_RETRY, $res)) { -- cgit v1.2.3-55-g7522