Skip to content

Commit

Permalink
Shorten on_shutdown callback call
Browse files Browse the repository at this point in the history
Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
  • Loading branch information
sloretz committed Dec 14, 2021
1 parent 0530656 commit e6fe67a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions rclpy/rclpy/clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,8 @@ def on_time_jump(time_jump: TimeJump):
if time_source_changed or self.now() >= until:
event.set()

def on_shutdown():
"""Wake when context is shut down."""
event.set()

context.on_shutdown(on_shutdown)
# Wake when context is shut down
context.on_shutdown(event.set)

threshold = JumpThreshold(
min_forward=Duration(nanoseconds=1),
Expand Down

0 comments on commit e6fe67a

Please sign in to comment.