From 5dfac6e689dd6068979869c7cd989cd32e4c6860 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 13 Feb 2019 14:37:51 +0100 Subject: use apcu instead of memcache --- buildmaster/deletion-links.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'buildmaster/deletion-links.php') diff --git a/buildmaster/deletion-links.php b/buildmaster/deletion-links.php index f474dc5..6d21bda 100644 --- a/buildmaster/deletion-links.php +++ b/buildmaster/deletion-links.php @@ -15,15 +15,8 @@ if (isset($_GET["pkgname"])) else $filter = ""; -$memcache = new Memcache; -if ($memcache -> connect('localhost', 11211)) { - $memcache_available = true; - $available_upstream_packages = $memcache -> get('available_upstream_packages'); -} else { - $memcache_available = false; - $available_upstream_packages = false; -} -if ($available_upstream_packages === false) { +$available_upstream_packages = apcu_fetch('available_upstream_packages', $apcu_success); +if ($apcu_success == false) { $available_upstream_packages = explode( "\n", shell_exec( @@ -32,11 +25,8 @@ if ($available_upstream_packages === false) { "| sort -u" ) ); - if ($memcache_available) - $memcache -> set('available_upstream_packages',$available_upstream_packages,0,1800); + apcu_store('available_upstream_packages', $available_upstream_packages, 1800); } -if ($memcache_available) - $memcache -> close(); mysql_run_query( "CREATE TEMPORARY TABLE `available` (" . -- cgit v1.2.3-70-g09d2