Skip to content

Instantly share code, notes, and snippets.

@ollo-ride-nico
Created March 4, 2019 14:38
Show Gist options
  • Save ollo-ride-nico/842901455b4f8dce0051b76191f6d07d to your computer and use it in GitHub Desktop.
Save ollo-ride-nico/842901455b4f8dce0051b76191f6d07d to your computer and use it in GitHub Desktop.
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