diff --git a/src/feather/app.py b/src/feather/app.py index 18cea48..63128f9 100755 --- a/src/feather/app.py +++ b/src/feather/app.py @@ -221,16 +221,22 @@ class FeatherApp: async def daemon(self): """Start the synchronization daemon""" - print( - f"Started in daemon mode; changes will be downloaded from the server every {self.config.daemon_sync_down_every}s and uploaded every {self.config.daemon_sync_up_every}s" - ) + config = self.config + if config.daemon_watch_files: + print( + f"Started in daemon mode; changes will be downloaded from the server every {config.daemon_sync_down_every_when_used} to {config.daemon_sync_down_every} seconds and uploaded every {config.daemon_sync_up_every_when_used} to {config.daemon_sync_up_every} seconds" + ) + else: + print( + f"Started in daemon mode; changes will be downloaded from the server every {config.daemon_sync_down_every}s and uploaded every {config.daemon_sync_up_every} seconds" + ) async with asyncio.TaskGroup() as tg: stop_sleep_up_event, stop_sleep_down_event = Event(), Event() tasks = [ tg.create_task(self.daemon_sync_up_loop(stop_sleep_up_event)), tg.create_task(self.daemon_sync_down_loop(stop_sleep_down_event)), ] - if self.config.daemon_watch_files: + if config.daemon_watch_files: tasks.append( tg.create_task( self.daemon_watch_loop( diff --git a/src/feather/config.default.toml b/src/feather/config.default.toml index f1387de..2580629 100644 --- a/src/feather/config.default.toml +++ b/src/feather/config.default.toml @@ -137,18 +137,17 @@ format = "%Y-%m-%d %H:%M" [daemon] # When running in daemon mode, Feather will download changes from the server (new articles, articles read state) at least every seconds. # Can be set through the environment variable DAEMON_SYNC_DOWN_EVERY. -sync_down_every = 900 +sync_down_every = 1800 # When running in daemon mode, Feather will upload local changes to the server (read articles) at least every seconds. # Can be set through the environment variable DAEMON_SYNC_UP_EVERY. -sync_up_every = 60 +sync_up_every = 300 # If true, enable the file watcher. -# When enabled, Feather will watch for file changes in the reader directory; when a change is detected, the time before the next up and down synchronization is reduced to and . -# This can be used to reduce network requests to the server while Feather is not in use. +# When enabled, Feather will watch for file changes in the reader directory; when a change is detected, the time before the next up and down synchronization is reduced to and , thus increasing synchronization frequency while Feather is in use. # Can be set through the environment variable DAEMON_WATCH_FILES. watch_files = true # If the file watcher is enabled and activity is detected, Feather will wait instead of seconds before the next down synchronization. # Can be set through the environment variable DAEMON_SYNC_DOWN_EVERY_WHEN_USED. -sync_down_every_when_used = 60 +sync_down_every_when_used = 300 # If the file watcher is enabled and activity is detected, Feather will wait instead of seconds before the next up synchronization. # Can be set through the environment variable DAEMON_SYNC_UP_EVERY_WHEN_USED. sync_up_every_when_used = 2