Genius Code Revamp: Prune Job Threaded for Unstoppable Performance!
Revolutionary update to @farcaster/hubble enhances efficiency by freeing the NodeJS main thread, paving the way for lightning-fast operations!
Commit Details:
fix: Run prune job in thread (#1782) ## Motivation Run the prune job in a thread so as to not block the NodeJS main thread ## Merge Checklist _Choose all relevant options below by adding an `x` now or at any time before submitting for review_ - [X] PR title adheres to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard - [X] PR has a [changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets) - [X] 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. - [X] All [commits have been signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits) <!-- start pr-codex --> --- ## PR-Codex overview This PR optimizes the `pruneMessagesJob` in `@farcaster/hubble` by running it in a thread to prevent blocking the NodeJS main thread. ### Detailed summary - Moved `pool` field out of `Store` struct - Added `messagePostFix` check in `index.ts` - Added `once_cell` dependency in `store.rs` - Improved error handling in `store.rs` - Implemented threadpool for `prune_messages` in `store.rs` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->