WindowsApiEmitter made easier to subclass.#344
Merged
Conversation
queue_events now does not call read_events directly. The call was put into a member function _read_events instead, to make it easier to replace the read_events functionality while keeping the rest of the class going.
|
I would like to know, how you solved that issue: I'm getting WindowsError: [Error 64] in read_directory_changes, when network-drive is sometimes not reachable. Would you be so kind to explain, how you managed to reconnect watchdog surveillance, if device is connected again? |
Contributor
Author
|
https://gist.github.com/petrblahos/7a5171d0f42297db2676c968c8034110 This works against current watchdog (without my PR applied). That's why I had to copy the whole winobserver from watchdog and add a thing here or there. With the patch applied, all things would happen in read_events function. |
Collaborator
|
@danilobellini I am OK to merge this one, WDYT? |
Collaborator
|
Thank you @petrblahos :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
queue_events now does not call read_events directly. The call
was put into a member function _read_events instead, to make
it easier to replace the read_events functionality while keeping
the rest of the class going.
I need to make the WindowsApiObserver reconnect on the network
failure. I achieve it by catching certain errors in get_directory_handle
and read_events, but with the way the code has been organized
I had to "copy/paste" whole read_directory_changes file. If I take the
read_events out of the queue_events, I can just override on_thread_start,
on_thread_stop and the new _read_events to achieve this.