Projects STRLCPY geneva Commits e7ea905c
🤬
  • Added closing logging handlers to __exit__ of engine -> fixes problem with running out of file descriptors (usually after 1024 runs)

  • Loading...
  • VwCSXg committed 2 years ago
    e7ea905c
    1 parent e495652a
  • ■ ■ ■ ■ ■ ■
    engine.py
    skipped 131 lines
    132 132   
    133 133   def __exit__(self, exc_type, exc_value, tb):
    134 134   """
    135  - Allows the engine to be used as a context manager; simply stops the engine
    136  - if enabled.
     135 + Allows the engine to be used as a context manager
     136 + Stops the engine if enabled and closes loggers.
    137 137   """
     138 + for handler in self.logger.handlers:
     139 + handler.close()
    138 140   if self.enabled:
    139 141   self.shutdown_nfqueue()
    140 142   
    skipped 330 lines
Please wait...
Page is in error, reload to recover