Use flushdb instead of flushall in RedisCacheAdapter#3523
Use flushdb instead of flushall in RedisCacheAdapter#3523flovilmart merged 1 commit intoparse-community:masterfrom
Conversation
|
@JeremyPlease @flovilmart I'm trying to better understand how the ParseServer redis Cache behaves. When two services (in our case ParseServer and Kue) use the same redis database, also flushdb would clear data for both services, right? |
|
@stefanraffeiner Unfortunately, redis doesn't have a simple command for "delete all keys that match prefix." To do that, we would need to read all keys that match prefix and delete each. I think the best thing to do is use different redis "databases" for each of your services. By default, redis has 6 databases (indexed from 0 to 15). You can set the Hope that helps! |
When a different db on the same redis server is used by another service Parse Server will currently flush that db on
clear().The Parse Server RedisCacheAdapter only reads/writes to one db on the redis server and should only flush that database (instead of all databases).
This fix replaces
flushallwithflushdb.