This repository was archived by the owner on Jan 31, 2026. It is now read-only.
refactor: bpt-queue Code Improvements: Debugging, Queue Management and Hardcap Disable#1036
Merged
bitpredator merged 2 commits intomainfrom Mar 19, 2025
Merged
refactor: bpt-queue Code Improvements: Debugging, Queue Management and Hardcap Disable#1036bitpredator merged 2 commits intomainfrom
bitpredator merged 2 commits intomainfrom
Conversation
1. Improved DebugPrint
- Added timestamp: Each debug message now includes a timestamp showing the exact time the message was printed.
This helps to track operations over time.
- Improved formatting: The message formatting has been made clearer by including the timestamp in a readable format.
2. Disabling hardcap resource
- Checking the resource before stopping it: Before calling StopResource("hardcap"), a check has been added (GetResourceState("hardcap") == "started") to verify that the resource is actually active.
This prevents errors or unnecessary calls when the resource is not running.
- Protection from repeated calls: Introduced the hardcapDisabled variable to ensure that disabling the resource only happens once, avoiding conflicts or double calls.
- Improved error messages: If the hardcap resource is not active and cannot be stopped, an error message is printed to better handle cases where the resource cannot be stopped.
3. Readability and maintainability improvements
- More modular code: Made the code more structured and easy to follow, by introducing explicit checks for resource management and protection against repeated operations.
- Clear debug messages: Debug messages are now more informative, with details on what is happening and when, thanks to the addition of a timestamp.
- Avoid unnecessary operations: Operations such as stopping the hardcap resource are now conditional, avoiding execution of actions when unnecessary.
4. Avoid conflicts or errors
- Avoid calling StopResource if the resource is not running: Adding the GetResourceState("hardcap") == "started" check prevents a resource from being stopped that is not currently active, reducing the risk of errors.
5. Improved resource health check
- Check resource load before stopping it: Introducing a check before stopping a resource helps ensure that it runs only when needed, improving performance and reducing unsolicited operations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #[issue_no]
All Submissions:
Please describe the changes this PR makes and why it should be merged:
Discord username (if different from GitHub):