stealthmonkey99 / OctoPrint-PWMBuzzer

M300 gcode handler (PWM buzzer via GPIO) for OctoPrint
6 stars 0 forks source link

Parsing files for M300 commands should not be blocking #4

Closed stealthmonkey99 closed 2 years ago

stealthmonkey99 commented 2 years ago

This is similar to issue #2 - when we first install this plugin and restart OctoPrint, it stalls for a while because we parse through all files looking for those that contain M300 commands. While we add metadata to the files to avoid parsing again on the same file content, I should ensure this logic is run on another thread as it is not a high-priority feature of the plugin (e.g. we could simply check files async and require another restart for M300 files to appear through template variables in the settings panel).