dwighthubbard / python-dlipower

Python modules to manage Digital Loggers Web Power Switch
Other
54 stars 35 forks source link

pool_fix #37

Closed lanquarden closed 6 years ago

lanquarden commented 6 years ago

Hi,

I ran into memory issues when repeatedly switching outlets, each time the command_on_outlets is called a pool is created, this pool however is not dissolved when the results have been obtained. It remains active to accept new jobs. Each worker thread will consume memory even if not active, hence every time you're switching you're consuming a bit more.

This is just the most basic fix, one could however, create a worker pool for every outlet at the beginning and reuse the pool every time.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.5%) to 71.475% when pulling 36787f1d8182456d9b9307f1713cba07c39a37d9 on lanquarden:pool_fix into 78c39653881d8cbb24af3cecc3e598a6637cbf05 on dwighthubbard:master.