NOAA-MDL / GIFTs

Generate IWXXM From TAC software
Other
11 stars 2 forks source link

Update iwxxmd.py to gracefully recover when observer object dies #45

Closed mgoberfield closed 1 week ago

mgoberfield commented 1 week ago

Not so much a bug with iwxxmd.py code as a need to gracefully recover when python's Watchdog observer quits responding to events in the monitored directory.

Steps to reproduce the behavior: Difficult to reproduce the issue but seems most likely to occur when there is rapid influx of new files (100+ files within a few minutes), but not always. I've found monitoring to run fine for weeks and then suddenly fail. Other times, the observer will fail after a few hours during quiescent times.

Watchdog module has a Observer is_alive() method to determine if the observer is okay. iwxxmd.py will be updated to use this and 'do the right thing' when the current observer stops working.