Skip to content

Conversation

dariogriffo
Copy link
Contributor

Added a configuration option to disable the loop that removes expired items.
By default it will run the loop.
This is useful when multiple processes access the same database/schema/table, ie: a webapi and 2 background services use the same cache configuration, ideally the loop should execute only in one of them.

@leonibr
Copy link
Owner

leonibr commented Jan 13, 2021

Lets talk about this...
I see your point but I think this control should be on the database so it could "cancel" deletion requests if time is less the minimum loop interval, what do you think @dariogriffo ?

@dariogriffo
Copy link
Contributor Author

Lets talk about this...
I see your point but I think this control should be on the database so it could "cancel" deletion requests if time is less the minimum loop interval, what do you think @dariogriffo ?

But how would that happen if they are 2 different applications. They have different memory space so they will be triggering the process independently.
That's the scenario I want to cover here.
For example the solution is 1 webapi and one background service communicating via a service bus.
Both share the same models hence they want to share the cache, let's say to access a customer configuration. I know ideally they will need to setup a different schema/table in their apps, but what if they don't?

@leonibr leonibr merged commit 3dcf3c2 into leonibr:master Jan 17, 2021
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.

2 participants