Skip to content

IRedisCollection<T>.UpdateAsync does not set the TTL value #540

@delepster

Description

@delepster

When using the UpdateAsync method to update an entry, the TTL gets updated to no limit even if I pass a TTL value. As a workaround, I need to delete the entry and recreate it:

await this._sessionCollection.UpdateAsync(new CachedServerSideSession(session), session.Expires - DateTime.UtcNow ?? TimeSpan.Zero);

TTL is set to no limit.

await this.DeleteSessionAsync(session.Key, cancellationToken);
await this.CreateSessionAsync(session, cancellationToken);

TTL has the right value.

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