Skip to content

Commit

Permalink
fix(shuttle): Correct example app to use await (#2234)
Browse files Browse the repository at this point in the history
## Why is this change needed?

This is leading to confusion. If you don't `await`, you can overwhelm
the event loop.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
This PR ensures the `processHubEvent` method is awaited when called in
the stream consumer, preventing it from being executed void.

### Detailed summary
- Changed `this.processHubEvent(event);` to `await
this.processHubEvent(event);` in the stream consumer to ensure proper
execution.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
  • Loading branch information
sds authored Aug 1, 2024
1 parent fa5f13b commit c5e4457
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shuttle/src/example-app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class App implements MessageHandler {
log.info("Starting stream consumer");
// Stream consumer reads from the redis stream and inserts them into postgres
await this.streamConsumer.start(async (event) => {
void this.processHubEvent(event);
await this.processHubEvent(event);
return ok({ skipped: false });
});
}
Expand Down

0 comments on commit c5e4457

Please sign in to comment.