From 51004835923b91fdf8550821077d2304b515c341 Mon Sep 17 00:00:00 2001 From: "sirko.bretschneider" Date: Mon, 20 Jul 2015 18:11:01 +0200 Subject: [PATCH] Delete status keys after completion --- src/Job/Status.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Job/Status.php b/src/Job/Status.php index 002057c..87f83dc 100644 --- a/src/Job/Status.php +++ b/src/Job/Status.php @@ -221,8 +221,10 @@ public function update($status) 'updated' => $this->attributes['updated'] )); - // Expire the status for completed jobs after 24 hours - if (in_array($status, self::$complete)) { + // Expire or delete the status for completed jobs after given time + if ($status == self::STATUS_COMPLETE) { + $this->client->del($this->getHashKey()); + } elseif (in_array($status, self::$complete)) { $this->client->expire($this->getHashKey(), self::COMPLETE_TTL); } else { $this->client->expire($this->getHashKey(), self::INCOMPLETE_TTL);