Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support restart via send SIGHUP #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions eth-proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import sys
import socket
import signal

from stratum import settings
import stratum.logger
Expand Down Expand Up @@ -49,6 +50,12 @@ def ping(f):
except Exception:
pass

def restart(signum, frame):
python = sys.executable
os.execl(python, python, * sys.argv)

signal.signal(signal.SIGHUP, restart)

@defer.inlineCallbacks
def on_connect(f):
'''Callback when proxy get connected to the pool'''
Expand Down