mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-11-02 03:16:02 +01:00
reactor: Add support for explicit Python garbage collection
Add support for performing Python gc work only from the main reactor thread and only when it appears the main thread is idle. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -306,6 +306,7 @@ def main():
|
||||
elif not options.debugoutput:
|
||||
logging.warning("No log file specified!"
|
||||
" Severe timing issues may result!")
|
||||
gc.disable()
|
||||
|
||||
# Start Printer() class
|
||||
while 1:
|
||||
@@ -313,7 +314,7 @@ def main():
|
||||
bglogger.clear_rollover_info()
|
||||
bglogger.set_rollover_info('versions', versions)
|
||||
gc.collect()
|
||||
main_reactor = reactor.Reactor()
|
||||
main_reactor = reactor.Reactor(gc_checking=True)
|
||||
printer = Printer(main_reactor, bglogger, start_args)
|
||||
res = printer.run()
|
||||
if res in ['exit', 'error_exit']:
|
||||
|
||||
Reference in New Issue
Block a user