Uninett / zino

Zino 2.0 - Network state monitor for research networks
Apache License 2.0
3 stars 4 forks source link

Only load and parse `polldevs.cf` if its `mtime` value has changed #282

Open lunkwill42 opened 2 days ago

lunkwill42 commented 2 days ago

This is an optimization employed by Zino 1, so Zino 2 should do it as well:

The polldevs.cf file is read and parsed on a set interval. Differences between polldevs.cf and the running configuration are detected and executed internally.

However, repeatedly parsing the full polldevs.cf is a waste of time if it rarely changes (time that could be spent polling devices, rather than blocking the event loop). The reloading routine should keep track of the modified-time (mtime) of the polldevs.cf file, and only initiate a reload if it detects that the file has been modified since it was last read.