Skip to content

Commit 8149a1e

Browse files
committed
Fix keys stats bug + force php-redis version
1 parent 2555a59 commit 8149a1e

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
logs/
2+
README.md

Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ RUN apt-get update && apt-get install -y \
77
gearman-job-server \
88
git-core \
99
libgearman-dev \
10+
redis-tools \
1011
&& pecl install gearman \
1112
&& docker-php-ext-enable gearman
1213

@@ -24,7 +25,9 @@ WORKDIR /usr/src
2425

2526
RUN git clone https://github.com/phpredis/phpredis.git
2627
WORKDIR /usr/src/phpredis
27-
RUN phpize \
28+
# Version 3 has a bug with zAdd so checkout to 2.2.8
29+
RUN git checkout tags/2.2.8 \
30+
&& phpize \
2831
&& ./configure \
2932
&& make \
3033
&& make install \

controllers/cron.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function indexAction()
2727
}
2828

2929
foreach ($this->infoModel->getDbs($info) as $i) {
30-
if (preg_match('/^keys=([0-9]+),expires=([0-9]+)$/', $info["db{$i}"], $matches)) {
30+
if (preg_match('/keys=([0-9]+),expires=([0-9]+)/', $info["db{$i}"], $matches)) {
3131
$statsModel->addKey("db{$i}:keys", $matches[1], $time);
3232
$statsModel->addKey("db{$i}:expired_keys", $matches[2], $time);
3333
}

0 commit comments

Comments
 (0)