Open NaLLiFFuNT opened 8 years ago
Hello , NaLLiFFuNT I let fork, where added to the TTL and EXPIRE for REDIS records See https://github.com/nailfor/yii2-redis Be aware, that fork incompatible with current keypool
Hello @nailfor How about doing a PR to share your code with the community?
Hello @thiagotalma i'm don't know how do it)) I written redis extension about 5 month ago and only 2-3 peoples downloaded it from packagist.org
@nailfor It's because people do not want to download a parallel extension. They only download the official one.
What you need to do is to rebase the master branch of that repository and open a PULL REQUEST to request that your modifications be incorporated into the official extension.
@thiagotalma ok, but my extension incompatible with the official keypool, because I used SADD to create unique keys, not RPUSH To work with an existing database, you must first convert the key pool like this redis-cli -n 0 LRANGE 'rd_user 0 -1 | awk' {print $ 1} '| xargs redis-cli -n 0 SADD rd_user_temp Therefore, I doubt that it will be able to add to the official thread
Same question. Someone can help?
@zacksleo see that: https://github.com/nailfor/yii2-redis/blob/master/EXAMPLES.md
@cebe Yii community need it strongly.
its hard to implement this because it would require redis to support TTL on items in a list, so a pk can be deleted from the PK lookup. Afaik this is not supported.
Of course это хард ту имплемент... При использовании RPUSH (in current version) возникают сложности отслеживания и работы с пулом ключей. Перебор ключей внешними средствами - долгая задача(но вполне реальная), гораздо быстрее сделать это средствами самого redis, у которого для этих целей есть метод SADD. Основная идея очень простая:
@nailfor it's better not to mix languages :)
@samdark as you wish
ActiveRecord expire
RedisActiveRecod does not have ability to be stored with some expire time.
What's expected?
Add method to RedisActiveRecod ttl() wich return time to live value in seconds. Every time when we will save or update model, we will apply expire command with this value to AR's keys. If ttl() method return false expire command doesn't have to be applied.