gunicorn.conf.py (327B)
1 from gateways import ssh_tunnel 2 3 4 def on_starting(server): 5 server.ssh_processes = ssh_tunnel.open_tunnels() 6 7 8 def on_reload(server): 9 ssh_tunnel.close_tunnels(server.ssh_processes) 10 server.ssh_processes = ssh_tunnel.open_tunnels() 11 12 13 def worker_exit(server, worker): 14 ssh_tunnel.close_tunnels(server.ssh_processes)