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

Improve add exclusion test #741

Closed
wants to merge 8 commits into from
Closed

Conversation

stavares843
Copy link
Contributor

@stavares843 stavares843 commented Jan 17, 2025

This PR includes the following:

  • Simplified how we run shell commands by using execAsync, which makes the code easier to read and maintain.
  • Pulled out repeated values like the Redis port, URL, and exclusion regex into constants, making the code cleaner and reducing hardcoding.
  • Added helpful log messages like "Starting Docker container..." and "Monitoring Redis queue..." to make debugging easier and the process more transparent.
  • Added a MAX_RETRIES limit to avoid endless loops while waiting for the Redis queue to populate. If it times out, it throws a meaningful error.
  • Ensured the Redis connection is always closed in a finally block to avoid leaving resources hanging.
  • Replaced the old callback-based approach with execAsync, making it easier to handle errors and promises.

@stavares843 stavares843 reopened this Jan 17, 2025
@stavares843 stavares843 changed the title Improve adblockrules test Improve add exclusion test Jan 17, 2025
@stavares843 stavares843 deleted the patch-1 branch January 17, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant