Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-02-13 08:34:10 +0100
committerErich Eckner <git@eckner.net>2019-02-13 08:34:10 +0100
commitf5175dca32467dbfecfc1d058b99e7b0a19b9764 (patch)
treec2929084babb8ff3854318adf2131a75fef16ae7 /packages
parentc8e86055394702bd8e257f78ff9a4a787116253d (diff)
buildmaster/deletion-links.php,lib/helper.php,packages/pkginfo.php: do not fail if memcache is unavailable
Diffstat (limited to 'packages')
-rw-r--r--packages/pkginfo.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/packages/pkginfo.php b/packages/pkginfo.php
index 7609d11..6cb3bab 100644
--- a/packages/pkginfo.php
+++ b/packages/pkginfo.php
@@ -26,8 +26,13 @@ require_once BASE . "/lib/mysql.php";
require_once BASE . "/lib/style.php";
$memcache = new Memcache;
- $memcache -> connect('localhost', 11211) or die ('Memcached Connection Error');
- $pkgapi_reachable = $memcache -> get('pkgapi_reachable');
+ if ($memcache -> connect('localhost', 11211)) {
+ $memcache_available = true;
+ $pkgapi_reachable = $memcache -> get('pkgapi_reachable');
+ } else {
+ $memcache_available = false;
+ $pkgapi_reachable = false;
+ }
$tld = explode('.', $_SERVER['HTTP_HOST']);
end($tld);
$tld = current($tld);
@@ -43,9 +48,11 @@ require_once BASE . "/lib/style.php";
$pkgapi_reachable = 'YES';
else
$pkgapi_reachable = 'NO';
- $memcache -> set('pkgapi_reachable', $pkgapi_reachable, 0, 300);
+ if ($memcache_available)
+ $memcache -> set('pkgapi_reachable', $pkgapi_reachable, 0, 300);
}
- $memcache -> close();
+ if ($memcache_available)
+ $memcache -> close();
if ($pkgapi_reachable == 'YES')
$skip_json_checks = false;
else