From 8149a1ebb6d1ae4f164ca4febeb9ba174b9586df Mon Sep 17 00:00:00 2001 From: Sasan Rose Date: Wed, 16 Nov 2016 12:41:18 +1100 Subject: [PATCH] Fix keys stats bug + force php-redis version --- .dockerignore | 1 + Dockerfile | 5 ++++- controllers/cron.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 333c1e9..6b755d8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ logs/ +README.md diff --git a/Dockerfile b/Dockerfile index 71d631e..76c7836 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ RUN apt-get update && apt-get install -y \ gearman-job-server \ git-core \ libgearman-dev \ + redis-tools \ && pecl install gearman \ && docker-php-ext-enable gearman @@ -24,7 +25,9 @@ WORKDIR /usr/src RUN git clone https://github.com/phpredis/phpredis.git WORKDIR /usr/src/phpredis -RUN phpize \ +# Version 3 has a bug with zAdd so checkout to 2.2.8 +RUN git checkout tags/2.2.8 \ + && phpize \ && ./configure \ && make \ && make install \ diff --git a/controllers/cron.php b/controllers/cron.php index 2651321..c6107cd 100644 --- a/controllers/cron.php +++ b/controllers/cron.php @@ -27,7 +27,7 @@ public function indexAction() } foreach ($this->infoModel->getDbs($info) as $i) { - if (preg_match('/^keys=([0-9]+),expires=([0-9]+)$/', $info["db{$i}"], $matches)) { + if (preg_match('/keys=([0-9]+),expires=([0-9]+)/', $info["db{$i}"], $matches)) { $statsModel->addKey("db{$i}:keys", $matches[1], $time); $statsModel->addKey("db{$i}:expired_keys", $matches[2], $time); }