diff options
author | Erich Eckner <git@eckner.net> | 2019-02-08 13:51:04 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-02-08 13:51:04 +0100 |
commit | 1da6ac89b5f863525d8bafd54f7123ff719a8149 (patch) | |
tree | 4bc52c8da6c3fc86e1ffbf6534d08e2e222f0d8c /lib/helper.php | |
parent | 5b9eb821e590859c3baaac9d08b07019f383eed2 (diff) | |
download | archweb32-1da6ac89b5f863525d8bafd54f7123ff719a8149.tar.xz |
close memcache connection if no longer needed
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/helper.php b/lib/helper.php index 8c910ac..b9a62fb 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -89,16 +89,17 @@ function git_url($repository,$type,$commit,$path,$line = null,$commit_is_hash = global $git_available; if (!isset($git_available)) { $memcache = new Memcache; - $memcache->connect('localhost', 11211) or die ('Memcached Connection Error'); - $git_available = $memcache->get('git_available'); + $memcache -> connect('localhost', 11211) or die ('Memcached Connection Error'); + $git_available = $memcache -> get('git_available'); if ($git_available === false) { $git_available = preg_match( "/ 200 OK$/", get_headers("https://git.archlinux32.org/archlinux32/packages")[0] ); - $memcache->set('git_available',$git_available,0,120); + $memcache -> set('git_available',$git_available,0,120); }; + $memcache -> close(); $git_available = $git_available == 1; } if (!isset($commit_is_hash)) |