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

"schemaCacheTTL" ParseServerOption is not working #7119

Closed
3 tasks done
jack092123 opened this issue Jan 11, 2021 · 10 comments · Fixed by #7138
Closed
3 tasks done

"schemaCacheTTL" ParseServerOption is not working #7119

jack092123 opened this issue Jan 11, 2021 · 10 comments · Fixed by #7138
Labels
state:released Released as stable version state:released-beta Released as beta version type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@jack092123
Copy link
Contributor

New Issue Checklist

Issue Description

It seems schemaCacheTTL ParseServerOption is not working. It still follows cacheAdapter's setting.

Steps to reproduce

ParseOption
enableSingleSchemaCache: true,
schemaCacheTTL: 3600000, (1hr)
cacheAdapter: RedisCacheAdapter

Actual Outcome

After a simple request, I check the keys in Redis. The schema cache's TTL is 30 seconds which is the RedisCacheAdapter's default TTL.

Environment

Server

  • Parse Server version: 4.3.0
  • Operating system: MacOS
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 3.6
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local

I'm not quite sure, but I think the problem might be here. It doesn't pass the TTL config to the cache.

@davimacedo davimacedo added the type:bug Impaired feature or lacking behavior that is likely assumed label Jan 11, 2021
@davimacedo
Copy link
Member

@dplewis
Copy link
Member

dplewis commented Jan 11, 2021

Check the constructor

@jack092123
Copy link
Contributor Author

Hi @davimacedo @dplewis , is there any update?

The schemaCacheTTL was set to ttl at the constructor, but it doesn't pass to the cacheController at Line 33. I'm not sure is it the main problem here.

@davimacedo
Copy link
Member

Check the constructor

The constructor uses only the default value but not a value eventually passed via parse server options, right?

@dplewis
Copy link
Member

dplewis commented Jan 19, 2021

Should be passed here

const schemaCache = new SchemaCache(

@davimacedo
Copy link
Member

davimacedo commented Jan 19, 2021

@jack092123 would you mind to write a failing test case?

@jack092123
Copy link
Contributor Author

Hi @davimacedo, this is my first time reporting issue & writing a test script. So feel free to correct me if there is a mistake.

I add a failing test case to my forked repo here. So what should I do next? Summit a pull request?
https://github.com/jack092123/parse-server/blob/issue7119/spec/SchemaCache.spec.js

@davimacedo
Copy link
Member

Yes. You can open a PR with the test. Are you willed to also investigate and try to send a fix?

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Nov 1, 2021
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-beta Released as beta version type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants