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

fix: allow aborting a predicate scan #601

Merged
merged 5 commits into from
Jun 27, 2024
Merged

fix: allow aborting a predicate scan #601

merged 5 commits into from
Jun 27, 2024

Conversation

MicaiahReid
Copy link
Contributor

@MicaiahReid MicaiahReid commented May 30, 2024

Previously, when Chainhook was run as a service and the runloop to scan stacks/bitcoin predicates was set, we had no way to abort that scan. If a predicate was set to scan 1m blocks, but the user discovered the predicate was wrong and needed to delete, the user could delete the predicate from the store, but the scan thread had already started and would run until completion.

This PR adds an abort signal to an ongoing scan so that when a predicate is deregistered, the scan is canceled.

@MicaiahReid MicaiahReid requested a review from csgui May 30, 2024 19:04
@MicaiahReid MicaiahReid temporarily deployed to Development-mainnet May 30, 2024 19:33 — with GitHub Actions Inactive
@MicaiahReid MicaiahReid temporarily deployed to Development-testnet May 30, 2024 19:33 — with GitHub Actions Inactive
@MicaiahReid MicaiahReid temporarily deployed to Staging-mainnet May 31, 2024 14:56 — with GitHub Actions Inactive
@MicaiahReid MicaiahReid temporarily deployed to Staging-testnet May 31, 2024 14:56 — with GitHub Actions Inactive
@smcclellan smcclellan requested a review from rafaelcr June 10, 2024 19:38
Copy link
Collaborator

@rafaelcr rafaelcr left a comment

Choose a reason for hiding this comment

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

LGTM, just a small typo in an Enum

components/chainhook-cli/src/scan/common.rs Outdated Show resolved Hide resolved
@MicaiahReid MicaiahReid temporarily deployed to Development-mainnet June 18, 2024 17:06 — with GitHub Actions Inactive
@MicaiahReid MicaiahReid temporarily deployed to Development-testnet June 18, 2024 17:06 — with GitHub Actions Inactive
@MicaiahReid MicaiahReid merged commit bb2c99d into main Jun 27, 2024
16 checks passed
@MicaiahReid MicaiahReid deleted the cancel-scans branch June 27, 2024 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants