jazzband/django-redis

patch delete like methods to use unlink api

yuchunzhou opened this issue · 6 comments

The Redis server has a lazyfree-lazy-user-del feature, the server will run the DEL command as if running UNLINK command if this feature is on. Although user can config the redis server to enable the feature, but if user won't config it, the UNLINK is a better choice. I read the delete like methods code of django-redis, all of them just call redis-py's delete api, why not call unlink api?

I did not understand what are you talking about, could you elaborate more?

now I get it, I think we might want to add a flag on delete methods... would you fancy opening a PR for it?

@WisdomPill ok, i will push a pull request to the repository in a few days.

@WisdomPill yeah, maybe we should add a config option to the OPTIONS dict and call the right delete method obey that config option, the decision is in user's hand, user chooses the right delete method for different application situations. Or, we can add an optional parameter to the package's delete like methods of default client class, this should be a better way.

it might be a good idea, but imho it should be a flag so that it can be used when needed like when bulk deleting.

So both options are good together

@WisdomPill Maybe user should enable the lazyfree-lazy-user-del feature at the server, so i close this issue.