Closed kostko closed 1 year ago
It seems that currently republishing a duplicate message fails even after the timecache entry should have expired if that is the only message being (re)published. This is due to the sweep method only being called after Add which is only ever called when a new message is added in markSeen.
sweep
Add
markSeen
If we have a simple example where there is only a single message being republished, the sweep will never happen and thus the old message ID will be left stale in the timecache, preventing publication.
The timecache should either be swept periodically or before Has (see related issue https://github.com/whyrusleeping/timecache/issues/2).
Has
This has been fixed in the new in-tree timecache implementation by using a background goroutine that periodically sweeps.
It seems that currently republishing a duplicate message fails even after the timecache entry should have expired if that is the only message being (re)published. This is due to the
sweep
method only being called afterAdd
which is only ever called when a new message is added inmarkSeen
.If we have a simple example where there is only a single message being republished, the sweep will never happen and thus the old message ID will be left stale in the timecache, preventing publication.
The timecache should either be swept periodically or before
Has
(see related issue https://github.com/whyrusleeping/timecache/issues/2).