Skip to content

Publish heartbeat message every second#693

Merged
1Blademaster merged 5 commits intorelease-alpha-0.1.10from
alpha-0.1.10/692-publish-gcs-heartbeat
Sep 14, 2025
Merged

Publish heartbeat message every second#693
1Blademaster merged 5 commits intorelease-alpha-0.1.10from
alpha-0.1.10/692-publish-gcs-heartbeat

Conversation

@1Blademaster
Copy link
Copy Markdown
Member

@1Blademaster 1Blademaster commented Sep 14, 2025

and update is_active variable to use threading Event, fixed closing threads

@1Blademaster 1Blademaster changed the title Publish heartbeat message every second, update is_active variable to … Publish heartbeat message every second Sep 14, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the drone connection management system by changing the is_active variable from a boolean to a threading Event object, adds a heartbeat message functionality, and improves thread lifecycle management.

  • Replaced is_active boolean with threading Event for better thread synchronization
  • Added heartbeat message sending every second to maintain drone communication
  • Implemented proper thread cleanup with timeout-based queue operations and centralized thread stopping

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
radio/app/endpoints/autopilot.py Updated to use Event's is_set() method instead of direct boolean check
radio/app/drone.py Major refactoring to use Event for thread management, added heartbeat functionality, improved queue handling with timeouts, and centralized thread cleanup

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread radio/app/drone.py Outdated
Comment thread radio/app/drone.py
Copy link
Copy Markdown
Contributor

@NexInfinite NexInfinite left a comment

Choose a reason for hiding this comment

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

LGTM

@1Blademaster 1Blademaster merged commit 54f0e57 into release-alpha-0.1.10 Sep 14, 2025
7 checks passed
@1Blademaster 1Blademaster deleted the alpha-0.1.10/692-publish-gcs-heartbeat branch September 14, 2025 14:17
1Blademaster added a commit that referenced this pull request Sep 28, 2025
* Publish heartbeat message every second, update is_active variable to use Event, fixed closing threads

* Add timeout to join threads

* Fix mypy error

* Fix mypy issues

* Fix mypy issue again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants