Warning about logging to db?

This is my own dumb error but might be helpful to stop other people from making the same mistake with a watcher that says when huge numbers of logs are being written. I have a job that watches i2c and writes values to mqtt for jobs which then read these and convert to e.g. pH, DO. I didn’t realise that the topic I wrote to meant they all got automatically written to the sqlite db. So not only was my db about 5gb of random logs but also the db was getting slammed and probably the sd card as well. Not sure if there’s a way to warn people when writes to db are above a certain rate or something?


:man_facepalming:

That’s a pretty reasonable addition, yea. We already compute the inserts_in_last_60s for another reason - seems simple to extend that for this use case too.

1 Like

Yea I imagine that inserts_in_last_60s might be what stopped me from running the db backup command that alerted me to the problem in the first place (a good reminder to always think why it’s necessary before just blindly running --force)