Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix delayed queue premature data prune, add tests #58

Merged
merged 1 commit into from
Oct 1, 2023

Conversation

Siegrift
Copy link
Collaborator

Closes #43

While I was working on these tests I realized that the delayed queue should not purge the data during the get call. The implementation assumed that one queue will be called with just a single updateTime, but that may not be true because there can be multiple triggers (with different updateTimes).

The new implementation made get function pure and created a new prune function which can be called to remove the data that is no longer necessary. The queue is first initialized with a maximumUpdateTime which is the maximum update time across all triggers.

@Siegrift Siegrift requested a review from andreogle September 29, 2023 12:18
@Siegrift Siegrift self-assigned this Sep 29, 2023
@Siegrift Siegrift force-pushed the unit-test-delayed-queue branch from 52b7032 to 0110de2 Compare October 1, 2023 09:59
Base automatically changed from resolve-todos to main October 1, 2023 11:09
@Siegrift Siegrift force-pushed the unit-test-delayed-queue branch from 0110de2 to c1036d6 Compare October 1, 2023 11:10
@Siegrift Siegrift merged commit b85f585 into main Oct 1, 2023
3 checks passed
@Siegrift Siegrift deleted the unit-test-delayed-queue branch October 1, 2023 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add unit tests for pusher delayed queue
1 participant