You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue here is that rrulebase caches the length after the first call to count(), and this cache is not invalidated when changes are made to the rruleset:
This should be easy enough to fix, I can make sure it's fixed in 2.5.0. I am in general loathe to recommend building anything upon private methods or attributes, but in the meantime, anything that iterates over the rruleset should update the count, so list(rules) or something like: for _ in rules: pass (this is what rruleset.count() would be doing anyway if the cache were properly invalidated anyway, so it shouldn't degrade performance).
Seems like the ruleset.count() is getting cached after first call to it. An Example of this behavior -
Only after iterating over the ruleset , do we get the correct value , Example -
The text was updated successfully, but these errors were encountered: