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.

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
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