Created
March 4, 2019 14:38
-
-
Save ollo-ride-nico/842901455b4f8dce0051b76191f6d07d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TaskListener | |
{ | |
private $redis; | |
public function __construct(\Redis $redis) | |
{ | |
$this->redis = $redis; | |
} | |
public function postPersist(Task $task, LifecycleEventArgs $args) | |
{ | |
$this->redis->expire('[tasks_all][1]', 0); | |
} | |
public function postUpdate(Task $task, LifecycleEventArgs $args) | |
{ | |
$this->redis->expire('[tasks_all][1]', 0); | |
} | |
public function postRemove(Task $task, LifecycleEventArgs $args) | |
{ | |
$this->redis->expire('[tasks_all][1]', 0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment