Skip to content

Add a flag to let the update thread to exit when plugin is unloaded#340

Open
Sniffleupagus wants to merge 1 commit intojayofelony:noaifrom
Sniffleupagus:patch-7
Open

Add a flag to let the update thread to exit when plugin is unloaded#340
Sniffleupagus wants to merge 1 commit intojayofelony:noaifrom
Sniffleupagus:patch-7

Conversation

@Sniffleupagus
Copy link
Contributor

The update_value thread does not exit when the plugin is disabled. it sticks around until pwnagotchi exits.

Description

I added a boolean "keep_going = True" to the PisugarServer. In update_value, I changed "while true:" to "while keep_going:". Then in on_unload, keep_going it set False. The background thread will exit the next time it starts the loop.

Motivation and Context

Threads would accumulate when pisugarx is disabled/enabled.

  • [ X ] I have raised an issue to propose this change (required)

How Has This Been Tested?

Tested on pwnagotchi 2.9.5-3.

Types of changes

  • [ X ] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [ X ] My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • [ X ] I've read the CONTRIBUTION guide
  • [ X ] I have signed-off my commits with git commit -s

Signed-off-by: Sniffleupagus <129890632+Sniffleupagus@users.noreply.github.com>
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