Skip to content

Commit

Permalink
Fix polling setup
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalo-bulnes committed Dec 6, 2022
1 parent cd3cd2e commit 82b03f9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions securedrop_client/export/printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ def __init__(
self._cache.clear_on(self._poller.paused.entered)
self._cache.on_change_emit(self.status_changed)

self._poller.poll_by(lambda: self._printing_service.run_printer_preflight())
# This is a blocking call, which is no good.
#self._poller.poll_by(lambda: self._printing_service.run_printer_preflight())
# Alternatively, by taking advantage of the printing service features to loosen coupling:
# self._printing_service.connect_signals(
# print_preflight_check_requested=self._poller.polling.entered
# )
self._printing_service.connect_signals(
print_preflight_check_requested=self._poller.polling.entered
)

self._poller.wait_on(self._printing_service.printer_not_found_ready)
self._poller.wait_on(self._printing_service.printer_found_ready)
Expand Down

0 comments on commit 82b03f9

Please sign in to comment.