Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Redis capability to add diverse TTL #85

Closed
jeremymills opened this issue Feb 29, 2016 · 1 comment
Closed

Redis capability to add diverse TTL #85

jeremymills opened this issue Feb 29, 2016 · 1 comment

Comments

@jeremymills
Copy link

Currently, it seems the capability to set a TTL on an item in Redis is on instantiation as a set configuration value.

As redis has the ability to be used as a database, or cache. I believe the ability to set the TTL on item creation should be implemented.

For example in addItem(s) a new parameter $ttl = null could be appended on and default to the base $options->getTtl()

protected function internalSetItem(& $normalizedKey, & $value, $tt = NULL)
    {
        $redis   = $this->getRedisResource();
        $options = $this->getOptions();
        $ttl     = $ttl ?: $options->getTtl();

        ...

This will allow the ability to diversify the Redis adapter as a database AND cache storage, instead of one OR the other.

@jeremymills
Copy link
Author

Had a hard time finding adapter options setTtl (my bad) deleting this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant