What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Does Spryker provide any way to do a `TTL` command on a redis key?

Posts: 546 πŸ§‘πŸ»β€πŸš€ - Cadet

Does Spryker provide any way to do a TTL command on a redis key?

Welcome!

It looks like you're new here. Sign in or register to get started.

Comments

  • Solution Architect Posts: 28 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited January 2020

    I dont know any command for that. But if you need to clean up redis, maybe you can use idletime for that. https://unix.stackexchange.com/questions/197469/delete-redis-keys-that-have-been-inactive-for-30-days
    We actually had this case for redis session db and set redis Eviction Policy with max memory to auto remove 'old' keys (allkeys-lru https://redis.io/topics/lru-cache)

  • Posts: 546 πŸ§‘πŸ»β€πŸš€ - Cadet

    that's not what TTL is for πŸ˜‰
    what I mean is I need to check whether the key has been refreshed correclty or I need to run a refresh process

  • Posts: 546 πŸ§‘πŸ»β€πŸš€ - Cadet

    storing the expiry date in another key sounds like a bad idea if there is a TTL in redis for checking the expiry

  • Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    hi @UK5DS29L2 do u have to extend self on project level the redis client and the predisAdapter. We have made the same:
    RedisClient:

        /**
         * @param string $connectionKey
         * @param string $key
         * @param int $seconds
         *
         * @return bool
         */
        public function expire(string $connectionKey, string $key, int $seconds): bool;
    

    and predisApdapter

        /**
         * @param string $key
         * @param int $seconds
         *
         * @return bool
         */
        public function expire(string $key, int $seconds): bool;
    
  • Posts: 546 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited January 2020

    @UL65CH0MC you're talking about EXPIRE command which sets the expire value. I'm looking to lookup the current expire value but I'll just add my own implementation as you have suggested

  • Posts: 546 πŸ§‘πŸ»β€πŸš€ - Cadet

    now I realize you just added this as an example πŸ€¦β€β™‚οΈ

  • Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes... just as an example what do have to extend to get this.. πŸ˜‰ n.p.

Welcome!

It looks like you're new here. Sign in or register to get started.