From 0574ebf44a4c22999e38fa5e5c72d2b8985c301a Mon Sep 17 00:00:00 2001
From: albertony <12441419+albertony@users.noreply.github.com>
Date: Fri, 28 May 2021 11:41:30 +0200
Subject: [PATCH] vfs: do not print notice about missing poll-interval support
 when set to 0

Fixes #5359
---
 vfs/help.go | 2 +-
 vfs/vfs.go  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/vfs/help.go b/vfs/help.go
index b016d6880..39b41c47d 100644
--- a/vfs/help.go
+++ b/vfs/help.go
@@ -31,7 +31,7 @@ backend. Changes made through the mount will appear immediately or
 invalidate the cache.
 
     --dir-cache-time duration   Time to cache directory entries for. (default 5m0s)
-    --poll-interval duration    Time to wait between polling for changes.
+    --poll-interval duration    Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable. (default 1m0s)
 
 However, changes made directly on the cloud storage by the web
 interface or a different copy of rclone will only be picked up once
diff --git a/vfs/vfs.go b/vfs/vfs.go
index ab506f9ad..516596231 100644
--- a/vfs/vfs.go
+++ b/vfs/vfs.go
@@ -222,7 +222,7 @@ func New(f fs.Fs, opt *vfscommon.Options) *VFS {
 		vfs.pollChan = make(chan time.Duration)
 		do(context.TODO(), vfs.root.changeNotify, vfs.pollChan)
 		vfs.pollChan <- vfs.Opt.PollInterval
-	} else {
+	} else if vfs.Opt.PollInterval > 0 {
 		fs.Infof(f, "poll-interval is not supported by this remote")
 	}