Do we need to .SavePolicy?
mukill opened this issue · 4 comments
mukill commented
What is the point of using .SavePolicy when Add, Update, and Remove all seem to save the new lines to the db?
casbin-bot commented
imp2002 commented
The enforcer is in memory, do savePolicy()
save to DB for persistence. If you don't need persistence, don't do savePolicy()
mukill commented
@imp2002 it looks like we save to the db on each CUD action though from reading the source code? Isn't it redundant to also call save policy?
hsluoyz commented
@mukill if your adapter supports Auto-Save, then you don't need to manually call SavePolicy(), see: https://casbin.io/docs/adapters#autosave