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: prevent double start #580

Merged
merged 2 commits into from
Feb 7, 2024
Merged

feat: prevent double start #580

merged 2 commits into from
Feb 7, 2024

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented Feb 6, 2024

About the changes

Prevent unleash client from starting twice. It will prevent bugs that were previously fixed in the user space: Unleash/unleash#6141

Details:

  • added boolean status similar to existing statuses not to introduce a new pattern in code
  • the new started status is only used internally to prevent double repository and metrics start

Important files

Discussion points

Verified

This commit was signed with the committer’s verified signature.
kwasniew Mateusz Kwasniewski
@coveralls
Copy link

coveralls commented Feb 6, 2024

Coverage Status

coverage: 90.863% (+0.03%) from 90.834%
when pulling 5c3e147 on prevent-double-start
into 4e70a41 on main.

@kwasniew kwasniew requested review from ivarconr and sjaanus February 6, 2024 16:03

Verified

This commit was signed with the committer’s verified signature.
kwasniew Mateusz Kwasniewski
Copy link
Member

@nunogois nunogois left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -245,6 +247,8 @@ export class Unleash extends EventEmitter {
}

async start(): Promise<void> {
if(this.started) return;
this.started = true;
Copy link
Member

Choose a reason for hiding this comment

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

Oh, so this was the error. Ok, this is a great improvement.

Did you also check the destroy() method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want to start the client again after destroy? If not then destroy changes are not needed

@kwasniew kwasniew merged commit 113bfe6 into main Feb 7, 2024
@kwasniew kwasniew deleted the prevent-double-start branch February 7, 2024 07:34
renovate bot referenced this pull request in Unleash/unleash Feb 20, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [unleash-client](https://togithub.com/Unleash/unleash-client-node) |
[`5.5.0-beta.1` ->
`5.5.0`](https://renovatebot.com/diffs/npm/unleash-client/5.5.0-beta.1/5.5.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/unleash-client/5.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/unleash-client/5.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/unleash-client/5.5.0-beta.1/5.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/unleash-client/5.5.0-beta.1/5.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>Unleash/unleash-client-node (unleash-client)</summary>

###
[`v5.5.0`](https://togithub.com/Unleash/unleash-client-node/releases/tag/v5.5.0)

[Compare
Source](https://togithub.com/Unleash/unleash-client-node/compare/v5.5.0-beta.1...v5.5.0)

#### What's Changed

- feat: prevent double start by
[@&#8203;kwasniew](https://togithub.com/kwasniew) in
[https://github.com/Unleash/unleash-client-node/pull/580](https://togithub.com/Unleash/unleash-client-node/pull/580)
- chore: upgrade make-fetch-happen by
[@&#8203;kwasniew](https://togithub.com/kwasniew) in
[https://github.com/Unleash/unleash-client-node/pull/583](https://togithub.com/Unleash/unleash-client-node/pull/583)

**Full Changelog**:
Unleash/unleash-client-node@v5.4.0...v5.5.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 7pm every weekday,before 5am
every weekday" in timezone Europe/Madrid, Automerge - At any time (no
schedule defined).

🚦 **Automerge**: Enabled.

♻ **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 [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/Unleash/unleash).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMDAuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

None yet

4 participants