()
| 60 | |
| 61 | |
| 62 | def cleanup_spawned_processes(): |
| 63 | logger.info("Cleaning up kernels...") |
| 64 | for filename in os.listdir(config.KERNEL_PID_DIR): |
| 65 | fp = os.path.join(config.KERNEL_PID_DIR, filename) |
| 66 | if os.path.isfile(fp): |
| 67 | try: |
| 68 | pid = int(filename.split(".pid")[0]) |
| 69 | logger.debug("Killing process with pid %s" % pid) |
| 70 | os.remove(fp) |
| 71 | try: |
| 72 | if os.name == "nt": |
| 73 | os.kill(pid, signal.CTRL_BREAK_EVENT) |
| 74 | else: |
| 75 | os.kill(pid, signal.SIGKILL) |
| 76 | |
| 77 | # After successful kill, cleanup pid file |
| 78 | os.remove(fp) |
| 79 | |
| 80 | except Exception: |
| 81 | # Windows process killing is flaky |
| 82 | pass |
| 83 | except Exception as e: |
| 84 | logger.debug(e) |
| 85 | |
| 86 | |
| 87 | def start_snakemq(kc): |
nothing calls this directly
no outgoing calls
no test coverage detected