Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement FileWatcher #924

Merged
merged 1 commit into from
Nov 6, 2020
Merged

Implement FileWatcher #924

merged 1 commit into from
Nov 6, 2020

Conversation

fulmicoton
Copy link
Collaborator

No description provided.


while state.load(Ordering::Relaxed) == 1 {
if let Ok(checksum) = FileWatcher::compute_checksum(&path) {
if current_checksum.is_none() || current_checksum.unwrap() != checksum {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i prefer if let Some(current_checksum)= current_checksum_opt to make the it visible that this code cannot panic.

thread::sleep(if cfg!(test) {
Duration::from_millis(1)
} else {
DEFAULT_POLLING_INTERVAL
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

should we change the default value in test instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the value of DEFAULT_POLLING_INTERVAL i mean

@guilload guilload force-pushed the guilload--implement-poll-watcher branch from c480bd6 to 5e54eda Compare November 6, 2020 01:00
@guilload guilload force-pushed the guilload--implement-poll-watcher branch from 5e54eda to 2875deb Compare November 6, 2020 04:08
@fulmicoton fulmicoton merged commit 726d32e into main Nov 6, 2020
@fulmicoton fulmicoton deleted the guilload--implement-poll-watcher branch November 6, 2020 13:41
@fulmicoton fulmicoton mentioned this pull request Nov 7, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants