Skip to content

Commit

Permalink
Fix None.shutdown bug on rqd (#1145)
Browse files Browse the repository at this point in the history
* Fix None.shutdown bug on rqd

Besides that, also add variable args to on_interation as some versions of pynput will
call this methot passing interaction arguments.

* fix lint error
  • Loading branch information
DiegoTavares committed May 25, 2022
1 parent 4402c1a commit 76536a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions rqd/rqd/rqnetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ def start_grpc(self):

def stopGrpc(self):
"""Stops the gRPC server."""
self.grpcServer.shutdown()
del self.grpcServer
log.warning("Stopped grpc server")
if self.grpcServer:
self.grpcServer.shutdown()
del self.grpcServer

def closeChannel(self):
"""Closes the gRPC channel."""
Expand Down
3 changes: 2 additions & 1 deletion rqd/rqd/rqnimby.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ def __init__(self, rqCore):
on_scroll=self.on_interaction)
self.keyboard_listener = pynput.keyboard.Listener(on_press=self.on_interaction)

def on_interaction(self):
# pylint: disable=unused-argument
def on_interaction(self, *args):
""" interaction detected """
self.interaction_detected = True

Expand Down

0 comments on commit 76536a6

Please sign in to comment.