Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memoize doesn't give correct results with list as one of the parameter in API #445

Open
ashsharma96 opened this issue Jan 30, 2023 · 6 comments

Comments

@ashsharma96
Copy link

Hey Flask Caching Team,

When I tried to apply memoize decorator on one of my api which requires different parameters then its not giving right results.
For Example these are my api parameters:

{
  "Id": 11082,
  "Type": "QA",
  "stores":[1234, 2345, 3456, 4567]
}

Function returns :

Total Customer: 3000

Decorator I used for above parameters are:

@cache.memoize(timeout=30)

Configuration I used:

config={'CACHE_TYPE': 'SimpleCache'}

stores key in parameters takes a list which can take one or more than one numbers. For example when I use above mentioned parameters I get number of customers in these stores but lets say I reduce the parameters to below parameters:

 {
  "Id": 11082,
  "Type": "QA",
  "stores":[1234]
}

It should return result shared below:

Total Customer: 900

But for 30 seconds it shows 3000 and after 30 seconds it shows 900 customers. So is there are any way by which memoize can determine like if there's any change in the list of parameters.

Environment:

  • Python version: 3.7.6
  • Flask-Caching version: 2.0.2
@ashsharma96
Copy link
Author

@sh4nks Can you please check this one. This one is urgent.
Regards

@ashsharma96
Copy link
Author

@sh4nks anything on this one. Little urgent.

@ashsharma96
Copy link
Author

@sh4nks Can you please look into this. Its Urgent.

@sh4nks
Copy link
Collaborator

sh4nks commented Feb 9, 2023

@ashsharma96 I am sorry but I won't really have time for this. I have a full-time job, a family with a toddler so time is kinda precious for me! You can always investigate the issue yourself by checking out the repo.

@ashsharma96
Copy link
Author

@sh4nks Thanks for replying. I know everyone is busy but you are working on this library. That's why I asked you. Everyone have personal life. I just thought you may know this. Sorry to disturb you.

@EugeneTorap
Copy link

Hi @northernSage! Do you have free time for it?

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

No branches or pull requests

3 participants