-
Notifications
You must be signed in to change notification settings - Fork 31
miner receive signals flask server #5
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
Conversation
| if (self.order_type == OrderTypeEnum.SHORT and self.leverage > 0) or \ | ||
| (self.order_type == OrderTypeEnum.LONG and self.leverage < 0): | ||
| raise ValueError("Leverage must be negative for SHORT orders and positive for LONG orders.") | ||
| if abs(self.leverage) < ValiConfig.MIN_LEVERAGE and self.order_type != OrderTypeEnum.FLAT: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No check for MAX_LEVERAGE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think we have max leverage yet as a var. We should add that. Will do that as part of this PR
mining/sample_signal_request.py
Outdated
| if __name__ == "__main__": | ||
|
|
||
| # Define the URL endpoint | ||
| url = 'http://127.0.0.1:5000/api/receive-signal' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why port 5000?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug port (non-production)
Issue #2: Remove is_alive() checks from LivePriceFetcher._start_server() - Removed all is_alive() checks that would crash when called from HealthChecker daemon - Use terminate() and kill() directly (safe to call on dead processes) - Rely on connect() to verify server is working instead of process checks - Simplified startup logic with 2s wait + connection attempt Issue #4: Move timestamp update inside lock in auto_sync.py - Moved last_signal_sync_time_ms update into finally block inside lock - Prevents race condition where second sync starts before timestamp updates - Ensures timestamp is always updated even if sync fails Issue #5: Remove unused shutdown_dict logic from daemons - Removed shutdown_dict parameter from HealthChecker.__init__() - Removed shutdown_dict parameter from FeatureRefresher.__init__() - Changed while loops from "while not self.shutdown_dict" to "while True" - Daemons run indefinitely and terminate when main process exits (daemon=True) - Updated validator.py to not pass shutdown_dict to daemon initializations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Issue #2: Remove is_alive() checks from LivePriceFetcher._start_server() - Removed all is_alive() checks that would crash when called from HealthChecker daemon - Use terminate() and kill() directly (safe to call on dead processes) - Rely on connect() to verify server is working instead of process checks - Simplified startup logic with 2s wait + connection attempt Issue #4: Move timestamp update inside lock in auto_sync.py - Moved last_signal_sync_time_ms update into finally block inside lock - Prevents race condition where second sync starts before timestamp updates - Ensures timestamp is always updated even if sync fails Issue #5: Remove unused shutdown_dict logic from daemons - Removed shutdown_dict parameter from HealthChecker.__init__() - Removed shutdown_dict parameter from FeatureRefresher.__init__() - Changed while loops from "while not self.shutdown_dict" to "while True" - Daemons run indefinitely and terminate when main process exits (daemon=True) - Updated validator.py to not pass shutdown_dict to daemon initializations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Taoshi Pull Request
Description
[Provide a brief description of the changes introduced by this pull request.]
Related Issues (JIRA)
[Reference any related issues or tasks that this pull request addresses or closes.]
Checklist
Reviewer Instructions
[Provide any specific instructions or areas you would like the reviewer to focus on.]
Definition of Done
Checklist (for the reviewer)
Optional: Deploy Notes
[Any instructions or notes related to deployment, if applicable.]
/cc @mention_reviewer