diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-13 16:13:12 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-13 16:13:12 +0000 |
commit | 0496a98fe0b580937c378485ed00f80f8d988adf (patch) | |
tree | f0cbf25680aa0f99a1d1abf64d9c0a8b29d30a20 /utils | |
parent | 1565388e506f7c7226ba1aa26430492146f784b7 (diff) | |
download | rspamd-0496a98fe0b580937c378485ed00f80f8d988adf.tar.gz rspamd-0496a98fe0b580937c378485ed00f80f8d988adf.zip |
[Minor] Fix spinner update
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/rspamd_stats.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/rspamd_stats.pl b/utils/rspamd_stats.pl index 3af8c7bc8..822985ed9 100755 --- a/utils/rspamd_stats.pl +++ b/utils/rspamd_stats.pl @@ -693,9 +693,10 @@ sub numeric { sub spinner { my @spinner = qw{/ - \ |}; return - if ( ( time - $spinner_update_time ) < 1 ); - printf "%s\033[1D", $spinner[ time % @spinner ]; + if ( $json || ( time - $spinner_update_time ) < 1 ); + printf "%s\r", $spinner[ $spinner_update_time % @spinner ]; $spinner_update_time = time; + select()->flush(); } # Convert syslog timestamp to "ISO 8601 like" format |