mirror of
https://codeberg.org/Reuh/feather.git
synced 2025-10-27 10:09:32 +00:00
fix: change default daemon delays
This commit is contained in:
parent
0cf3e4dfc2
commit
72681be275
2 changed files with 14 additions and 9 deletions
|
|
@ -221,16 +221,22 @@ class FeatherApp:
|
||||||
|
|
||||||
async def daemon(self):
|
async def daemon(self):
|
||||||
"""Start the synchronization daemon"""
|
"""Start the synchronization daemon"""
|
||||||
print(
|
config = self.config
|
||||||
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"
|
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:
|
async with asyncio.TaskGroup() as tg:
|
||||||
stop_sleep_up_event, stop_sleep_down_event = Event(), Event()
|
stop_sleep_up_event, stop_sleep_down_event = Event(), Event()
|
||||||
tasks = [
|
tasks = [
|
||||||
tg.create_task(self.daemon_sync_up_loop(stop_sleep_up_event)),
|
tg.create_task(self.daemon_sync_up_loop(stop_sleep_up_event)),
|
||||||
tg.create_task(self.daemon_sync_down_loop(stop_sleep_down_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(
|
tasks.append(
|
||||||
tg.create_task(
|
tg.create_task(
|
||||||
self.daemon_watch_loop(
|
self.daemon_watch_loop(
|
||||||
|
|
|
||||||
|
|
@ -137,18 +137,17 @@ format = "%Y-%m-%d %H:%M"
|
||||||
[daemon]
|
[daemon]
|
||||||
# When running in daemon mode, Feather will download changes from the server (new articles, articles read state) at least every <sync_down_every> seconds.
|
# When running in daemon mode, Feather will download changes from the server (new articles, articles read state) at least every <sync_down_every> seconds.
|
||||||
# Can be set through the environment variable DAEMON_SYNC_DOWN_EVERY.
|
# 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 <sync_up_every> seconds.
|
# When running in daemon mode, Feather will upload local changes to the server (read articles) at least every <sync_up_every> seconds.
|
||||||
# Can be set through the environment variable DAEMON_SYNC_UP_EVERY.
|
# 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.
|
# 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 <sync_up_every_when_used> and <sync_down_every_when_used>.
|
# 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 <sync_up_every_when_used> and <sync_down_every_when_used>, thus increasing synchronization frequency while Feather is in use.
|
||||||
# This can be used to reduce network requests to the server while Feather is not in use.
|
|
||||||
# Can be set through the environment variable DAEMON_WATCH_FILES.
|
# Can be set through the environment variable DAEMON_WATCH_FILES.
|
||||||
watch_files = true
|
watch_files = true
|
||||||
# If the file watcher is enabled and activity is detected, Feather will wait <sync_down_every_when_used> instead of <sync_down_every> seconds before the next down synchronization.
|
# If the file watcher is enabled and activity is detected, Feather will wait <sync_down_every_when_used> instead of <sync_down_every> seconds before the next down synchronization.
|
||||||
# Can be set through the environment variable DAEMON_SYNC_DOWN_EVERY_WHEN_USED.
|
# 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 <sync_up_every_when_used> instead of <sync_up_every> seconds before the next up synchronization.
|
# If the file watcher is enabled and activity is detected, Feather will wait <sync_up_every_when_used> instead of <sync_up_every> seconds before the next up synchronization.
|
||||||
# Can be set through the environment variable DAEMON_SYNC_UP_EVERY_WHEN_USED.
|
# Can be set through the environment variable DAEMON_SYNC_UP_EVERY_WHEN_USED.
|
||||||
sync_up_every_when_used = 2
|
sync_up_every_when_used = 2
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue