未验证 提交 de6bac41 编写于 作者: C chenjian 提交者: GitHub

fix bug for interrupting failure in windows (#1218)

上级 799dba68
...@@ -8,7 +8,6 @@ requests ...@@ -8,7 +8,6 @@ requests
six >= 1.14.0 six >= 1.14.0
matplotlib matplotlib
pandas pandas
multiprocess
packaging packaging
x2paddle x2paddle
rarfile rarfile
......
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
# ======================================================================= # =======================================================================
import os import os
import re import re
from multiprocessing import Process
from multiprocessing import Queue
from threading import Lock from threading import Lock
from threading import Thread from threading import Thread
import packaging.version import packaging.version
from multiprocess import Process
from multiprocess import Queue
from .parser.const_description import * # noqa: F403 from .parser.const_description import * # noqa: F403
from .parser.event_node import load_profiler_json from .parser.event_node import load_profiler_json
......
...@@ -17,6 +17,7 @@ import json ...@@ -17,6 +17,7 @@ import json
import multiprocessing import multiprocessing
import os import os
import re import re
import signal
import sys import sys
import threading import threading
import time import time
...@@ -78,6 +79,9 @@ def create_app(args): # noqa: C901 ...@@ -78,6 +79,9 @@ def create_app(args): # noqa: C901
lang = request.accept_languages.best_match(support_language) lang = request.accept_languages.best_match(support_language)
return lang return lang
signal.signal(
signal.SIGINT, signal.SIG_DFL
) # we add this to prevent SIGINT not work in multiprocess queue waiting
babel = Babel(app, locale_selector=get_locale) # noqa:F841 babel = Babel(app, locale_selector=get_locale) # noqa:F841
# Babel api from flask_babel v3.0.0 # Babel api from flask_babel v3.0.0
api_call = create_api_call(args.logdir, args.model, args.cache_timeout) api_call = create_api_call(args.logdir, args.model, args.cache_timeout)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册