Skip to content

Delete operation performs the store.delete twice #170

@jarifibrahim

Description

@jarifibrahim

When an item is deleted by cache.Del(key), we delete it from the store on the following line
https://github.com/dgraph-io/ristretto/blob/a093fe661329ba68a99a9c3a63674992355f40b1/cache.go#L248-L259

the same item is deleted again in the process() goroutine
https://github.com/dgraph-io/ristretto/blob/a093fe661329ba68a99a9c3a63674992355f40b1/cache.go#L331-L334

I don't think there's a major side-effect of doing this but we're doing unnecessary work by deleting an already deleted key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions