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

feat: add deduplication logic #2796

Merged
merged 4 commits into from
Oct 7, 2024
Merged

feat: add deduplication logic #2796

merged 4 commits into from
Oct 7, 2024

Conversation

roggervalf
Copy link
Collaborator

No description provided.

Copy link
Contributor

@manast manast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments on the documentation side of things.


## Fixed Mode

In the Fixed Mode, debouncing works by assigning a delay (Time to Live, TTL) to a job upon its creation. If a similar job (identified by a unique debouncer ID) is added during this delay period, it is ignored. This prevents the queue from being overwhelmed with multiple instances of the same task, thus optimizing the processing time and resource utilization.
In the Fixed Mode, deduplication works by assigning a delay (Time to Live, TTL) to a job upon its creation. If a similar job (identified by a unique deduplication ID) is added during this delay period, it is ignored. This prevents the queue from being overwhelmed with multiple instances of the same task, thus optimizing the processing time and resource utilization.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mode should be called "Throttle" right?


## Extended Mode

The Extended Mode takes a different approach by extending the debouncing duration until the job's completion or failure. This means as long as the job remains in an incomplete state (neither succeeded nor failed), any subsequent job with the same debouncer ID will be ignored.
The Extended Mode takes a different approach by extending the deduplication duration until the job's completion or failure. This means as long as the job remains in an incomplete state (neither succeeded nor failed), any subsequent job with the same deduplication ID will be ignored.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of "Extended" which does not have any semantic meaning in the actual use of this feature but more about how it is implemented, I would rename it to just: "Simple Deduplication". And move it at the top, as this mode is simpler than the throttle which requires an extra argument "ttl".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

@roggervalf roggervalf changed the title refactor: add deduplication logic feat: add deduplication logic Oct 5, 2024
Copy link
Contributor

@manast manast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@roggervalf roggervalf merged commit 0a4982d into master Oct 7, 2024
11 checks passed
@roggervalf roggervalf deleted the deduplication branch October 7, 2024 15:54
github-actions bot pushed a commit that referenced this pull request Oct 7, 2024
# [5.17.0](v5.16.0...v5.17.0) (2024-10-07)

### Bug Fixes

* **sandbox:** catch exit errors ([#2800](#2800)) ([6babb9e](6babb9e))

### Features

* **job:** add deduplication logic ([#2796](#2796)) ([0a4982d](0a4982d))
alexandresoro pushed a commit to alexandresoro/ouca that referenced this pull request Oct 7, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [bullmq](https://bullmq.io/) ([source](https://github.com/taskforcesh/bullmq)) | dependencies | minor | [`5.16.0` -> `5.17.1`](https://renovatebot.com/diffs/npm/bullmq/5.16.0/5.17.1) |

---

### Release Notes

<details>
<summary>taskforcesh/bullmq (bullmq)</summary>

### [`v5.17.1`](https://github.com/taskforcesh/bullmq/releases/tag/v5.17.1)

[Compare Source](taskforcesh/bullmq@v5.17.0...v5.17.1)

##### Bug Fixes

-   **repeat:** also consider startDate when using "every" ([25bbaa8](taskforcesh/bullmq@25bbaa8))

### [`v5.17.0`](https://github.com/taskforcesh/bullmq/releases/tag/v5.17.0)

[Compare Source](taskforcesh/bullmq@v5.16.0...v5.17.0)

##### Bug Fixes

-   **sandbox:** catch exit errors ([#&#8203;2800](taskforcesh/bullmq#2800)) ([6babb9e](taskforcesh/bullmq@6babb9e))

##### Features

-   **job:** add deduplication logic ([#&#8203;2796](taskforcesh/bullmq#2796)) ([0a4982d](taskforcesh/bullmq@0a4982d))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMTAuMiIsInVwZGF0ZWRJblZlciI6IjM4LjExMC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Reviewed-on: https://git.tristess.app/alexandresoro/ouca/pulls/201
Reviewed-by: Alexandre Soro <code@soro.dev>
Co-authored-by: renovate <renovate@git.tristess.app>
Co-committed-by: renovate <renovate@git.tristess.app>
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.

2 participants