Skip to content

Commit

Permalink
fix(signal): remove win incompatible signal
Browse files Browse the repository at this point in the history
  • Loading branch information
shidenggui committed Sep 29, 2016
1 parent 253fdb1 commit 8392fcf
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions easyquant/main_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,10 @@ def __init__(self, broker=None, need_data=None, quotation_engines=None,
self.after_shutdown = [] # 关闭引擎后的 shutdown
self.shutdown_signals = [
signal.SIGINT, # 键盘信号
signal.SIGHUP, # nohup 命令
signal.SIGTERM, # kill 命令
]
if sys.platform != 'win32':
self.shutdown_signals.append(signal.SIGQUIT)
self.shutdown_signals.extend([signal.SIGHUP, signal.SIGQUIT])

for s in self.shutdown_signals:
# 捕获退出信号后的要调用的,唯一的 shutdown 接口
Expand Down Expand Up @@ -202,20 +201,12 @@ def _load_strategy(self):
print(e)

def get_strategy(self, name):
"""
:param name:
:return:
"""
for strategy in self.strategy_list:
if strategy.name == name:
return strategy
return None

def get_quotation(self, eventype):
"""
:param name:
:return:
"""
for quo in self.quotation_engines:
if quo.EventType == eventype:
return quo
Expand Down

0 comments on commit 8392fcf

Please sign in to comment.