nohm icon indicating copy to clipboard operation
nohm copied to clipboard

.remove() on instance that has old values doesn't delete everything

Open maritz opened this issue 2 years ago • 1 comments

When an instance is removed, it only removes indices/uniquelocks for the values that have been loaded into that instance.

A static .remove() (aka with an unloaded instance or on the static class) does a load immediately before removing and thus rarely runs into this issue, but it still isn't atomic.

Instead a more thorough live search of ids in all indices has to be performed. This is costly, so it would also be a good target for future improvements by making it a lua script.

maritz avatar Apr 07 '22 15:04 maritz

Another more "atomic" way would be to create a lock immediately on remove and then do a more costly SCAN iteratively.

Also possibly removing the on-instance .remove() in favor of always using a static one that requires an id attribute.

maritz avatar Apr 07 '22 16:04 maritz