mirror of https://github.com/Kkevsterrr/geneva
Added closing logging handlers to __exit__ of engine
-> fixes problem with running out of file descriptors (usually after 1024 runs)
This commit is contained in:
parent
e495652a4a
commit
e7ea905c45
|
@ -132,9 +132,11 @@ class Engine():
|
|||
|
||||
def __exit__(self, exc_type, exc_value, tb):
|
||||
"""
|
||||
Allows the engine to be used as a context manager; simply stops the engine
|
||||
if enabled.
|
||||
Allows the engine to be used as a context manager
|
||||
Stops the engine if enabled and closes loggers.
|
||||
"""
|
||||
for handler in self.logger.handlers:
|
||||
handler.close()
|
||||
if self.enabled:
|
||||
self.shutdown_nfqueue()
|
||||
|
||||
|
|
Loading…
Reference in New Issue