Skip to content

Wondering why FINGERPRINTS_PREFIX SUBSCRIPTIONS_PREFIX keys don't have EXPIRE? #25

@gastonmorixe

Description

@gastonmorixe

We only apply EXPIRE to CHANNEL_PREFIX and SUBSCRIPTION_PREFIX. Would like to understand the reasons why we can't apply it to the other keys.

redis.multi do |pipeline|
pipeline.sadd(CHANNEL_PREFIX + channel_uniq_id, subscription_id)
pipeline.mapped_hmset(SUBSCRIPTION_PREFIX + subscription_id, data)
events.each do |event|
pipeline.zincrby(FINGERPRINTS_PREFIX + event.topic, 1, event.fingerprint)
pipeline.sadd(SUBSCRIPTIONS_PREFIX + event.fingerprint, subscription_id)
end
next unless config.subscription_expiration_seconds
pipeline.expire(CHANNEL_PREFIX + channel_uniq_id, config.subscription_expiration_seconds)
pipeline.expire(SUBSCRIPTION_PREFIX + subscription_id, config.subscription_expiration_seconds)
end
end

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions