Skip to content

Conversation

@enirood-p
Copy link

@enirood-p enirood-p commented Jul 13, 2023

  • added auto flush on TTL expiry [for non Mnesia cache]
  • transactions to serialize flush and get (in case of cache miss) [for Mnesia caches]

Copy link
Collaborator

@amarBitMan amarBitMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

mnesia:lock({TableName, MnesiaKey}, write),
ets:delete(CacheName, Key)
end,
{atomic, Result} = db_functions:apply_transaction(FlushFun),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're doing it this way, it's no longer like a library.

Either think of a way to make this generic to keep it like a library, or just move simple_cache to our code as a set of modules and make changes there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants