square / mongo-lock

Distributed locking with MongoDB.
Apache License 2.0
77 stars 20 forks source link

The Purge method does not remove #17

Open marusicbostjan opened 1 year ago

marusicbostjan commented 1 year ago

Despite the fact that the comment in purge.go says "Purge deletes expired locks...", the Purge method does not do a delete/remove of entries in the locks collection. As a result these entries tend to accumulate over time.

Currently the Purge method only removes the locks information from the mongo collection with FindOneAndUpdate. I would be nice if Purge implemented a proper garbage collection.

dariuschandrafoodpanda commented 4 months ago

Agree with this one. Can the owner of this repo please merge this change? It is very useful to have the entries cleaned up every period