add new command EXPIRE#167
Conversation
Signed-off-by: Issif <issif+github@gadz.org>
| } | ||
|
|
||
| // SetTTL sets the ttl in the document | ||
| func (d Document) SetTTL(ttl int) Document { |
There was a problem hiding this comment.
I can definitely see the value... But perhaps we should at least set a default TTL of -1 during the New.
There was a problem hiding this comment.
Without the set, it's by default to -1
There was a problem hiding this comment.
Correct - I just prefer being explicit.
There was a problem hiding this comment.
I'm in holidays, I'll update this PR when I'm back
There was a problem hiding this comment.
I thought and I think we should let the code like this, in this current setup, if the TTL is not set, we follow the Redis default behavior and the keys have no expiration, if we set the TTL, a second command is run to add an expiration to the key. It means, if we don't need to set the TTL we run only 1 command and not 2. For huge workload, it can be useful to avoid to run 2 commands when it's not necessary. wdyt?
|
Kudos, SonarCloud Quality Gate passed!
|
|
what's the status? thanks |
|
Hi, My project is using my fork but I would like to plug it on the upstream, what can I do to move forward with this PR please? |
|












For my project,
falcosidekick-uiI useredisearchas storage for the events, it works really well but the community asked me to add a TTL to keys. It's not currently possible in this SDK, so updated theDocumentstructure with a new fieldTTLand created a methodSetTTL. I tested my fork in my program, and it worksSigned-off-by: Issif issif+github@gadz.org