Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f0e6d85

Browse files
committed
feat: add user_requested_polling field for future polling mode detection
- Add user_requested_polling field to Observer struct - Store original user intent when Observer is created - Preserve distinction between user-requested vs system-forced polling - Infrastructure for future FileAppeared message suppression in polling mode Current implementation maintains existing behavior while providing foundation for distinguishing explicit --use-polling from automatic polling fallback
1 parent 9970fd3 commit f0e6d85

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/uu/tail/src/follow/watch.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ pub struct Observer {
162162
/// platform specific event driven method. Since `use_polling` is subject to
163163
/// change during runtime it is moved out of [`Settings`].
164164
pub use_polling: bool,
165+
166+
/// Tracks if user explicitly requested polling via --use-polling flag.
167+
/// Unlike `use_polling`, this doesn't change if system forces polling.
168+
pub user_requested_polling: bool,
165169

166170
pub watcher_rx: Option<WatcherRx>,
167171
pub orphans: Vec<PathBuf>,
@@ -191,6 +195,7 @@ impl Observer {
191195
retry,
192196
follow,
193197
use_polling,
198+
user_requested_polling: use_polling, // Store original user intent
194199
watcher_rx: None,
195200
orphans: Vec::new(),
196201
files,

0 commit comments

Comments
 (0)