Mercurial > hg > egg-tcls
changeset 395:33b5e7adc30c
fetch_weather: Make purge_threshold output some information when debugging.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 05 Jan 2017 23:15:31 +0200 |
parents | 315f31e4f964 |
children | dbf1d58915f8 |
files | fetch_weather.pl |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/fetch_weather.pl Thu Jan 05 23:14:55 2017 +0200 +++ b/fetch_weather.pl Thu Jan 05 23:15:31 2017 +0200 @@ -537,6 +537,7 @@ if ($purge > 0) { my $wqtime = time(); + my $nold = scalar(keys %$weatherdata); foreach my $key (keys %$weatherdata) { @@ -545,6 +546,9 @@ delete $$weatherdata{$key}; } } + + my $nnew = scalar(keys %$weatherdata); + print STDERR "Purged data older than ".$purge." minutes, ".$nold." -> ".$nnew." = ".($nold - $nnew)." removed.\n" if (opt_get_int("debug") > 0); } }