Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/listen/adapter/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def stop
private

def _stop
@run_thread&.kill
@run_thread.kill.join if @run_thread

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Style/SafeNavigation: Use safe navigation (&.) instead of checking if an object exists before calling the method.

@run_thread = nil
end

Expand Down
2 changes: 1 addition & 1 deletion lib/listen/adapter/darwin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _process_event(dir, path)
end

def _stop
@worker_thread&.kill
@worker_thread.kill.join if @worker_thread

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Style/SafeNavigation: Use safe navigation (&.) instead of checking if an object exists before calling the method.

super
end
end
Expand Down
3 changes: 1 addition & 2 deletions spec/lib/listen/adapter/polling_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@
expect(snapshot).to receive(:invalidate).
with(:dir, '.', { recursive: true })

t = Thread.new { subject.start }
subject.start
sleep 0.25
t.kill
end
end

Expand Down