isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit b9a4746b54cd4159941e4bb4650d75cb26a84a25
parent 460bfbb8ac1eb3cb106bd816566f93ff66d2190f
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Mon,  4 Jul 2022 18:03:24 +0200

don't refresh progress counters pointlessly

the mainloop-based refresh timer keeps spinning even if there is no
update. overload stats_steps to signal whether a refresh is needed.

amends 8fbc4323.

Diffstat:
Msrc/main_sync.c | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/main_sync.c b/src/main_sync.c @@ -43,9 +43,11 @@ print_stats( void ) static void stats_timeout( void *aux ATTR_UNUSED ) { - stats_steps = -1; + if (stats_steps != -1) { + stats_steps = -1; + print_stats(); + } conf_wakeup( &stats_wakeup, 200 ); - print_stats(); } void @@ -55,8 +57,10 @@ stats( void ) return; // If the main loop appears to be running, skip the sync path. - if (stats_steps < 0) + if (stats_steps < 0) { + stats_steps = -2; return; + } // Rate-limit the (somewhat) expensive timer queries. if (++stats_steps < 10)