projects
/
air-quality
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
226479f
)
handle slower iio_info and skip sleep
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 21 Feb 2021 12:20:10 +0000
(12:20 +0000)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 21 Feb 2021 12:20:10 +0000
(12:20 +0000)
iio2mqtt.pl
patch
|
blob
|
history
diff --git
a/iio2mqtt.pl
b/iio2mqtt.pl
index
14c9430
..
40c4983
100755
(executable)
--- a/
iio2mqtt.pl
+++ b/
iio2mqtt.pl
@@
-57,5
+57,8
@@
while(1) {
system "curl --silent -XPOST '$influx_url' --data-binary '$influx'";
warn "$influx\n";
- sleep Time::HiRes::time + $delay - $t;
+ my $dt = Time::HiRes::time + $delay - $t - 100;
+ if ( $dt > 0 ) {
+ sleep $dt;
+ }
}