Skip to content

Commit

Permalink
chore: fixes bug in log message around RECONNECT events (#931)
Browse files Browse the repository at this point in the history
## Description
Fixes bug in log message around `RECONNECT` events, it was expecting two
arguments when only one is emitted.

There is additional context in this
[comment](#930 (comment))
on the issue.

## Related Issue

Fixes #930 
<!-- or -->
Relates to #

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://docs.pepr.dev/main/contribute/#submitting-a-pull-request)
followed

---------

Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Co-authored-by: Barrett <81570928+btlghrants@users.noreply.github.com>
  • Loading branch information
cmwylie19 and btlghrants authored Jul 1, 2024
1 parent 848389a commit e21370e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/watch-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ async function runBinding(binding: Binding, capabilityNamespaces: string[]) {
watcher.events.on(WatchEvent.CONNECT, url => logEvent(WatchEvent.CONNECT, url));

watcher.events.on(WatchEvent.DATA_ERROR, err => logEvent(WatchEvent.DATA_ERROR, err.message));
watcher.events.on(WatchEvent.RECONNECT, (err, retryCount) =>
logEvent(WatchEvent.RECONNECT, err ? `Reconnecting after ${retryCount} attempts` : ""),
watcher.events.on(WatchEvent.RECONNECT, retryCount =>
logEvent(WatchEvent.RECONNECT, `Reconnecting after ${retryCount} attempt${retryCount === 1 ? "" : "s"}`),
);
watcher.events.on(WatchEvent.RECONNECT_PENDING, () => logEvent(WatchEvent.RECONNECT_PENDING));
watcher.events.on(WatchEvent.GIVE_UP, err => logEvent(WatchEvent.GIVE_UP, err.message));
Expand Down

0 comments on commit e21370e

Please sign in to comment.