Skip to content

Commit de6bac4

Browse files
authored
fix bug for interrupting failure in windows (#1218)
1 parent 799dba6 commit de6bac4

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ requests
88
six >= 1.14.0
99
matplotlib
1010
pandas
11-
multiprocess
1211
packaging
1312
x2paddle
1413
rarfile

visualdl/component/profiler/profiler_reader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
# =======================================================================
1515
import os
1616
import re
17+
from multiprocessing import Process
18+
from multiprocessing import Queue
1719
from threading import Lock
1820
from threading import Thread
1921

2022
import packaging.version
21-
from multiprocess import Process
22-
from multiprocess import Queue
2323

2424
from .parser.const_description import * # noqa: F403
2525
from .parser.event_node import load_profiler_json

visualdl/server/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import multiprocessing
1818
import os
1919
import re
20+
import signal
2021
import sys
2122
import threading
2223
import time
@@ -78,6 +79,9 @@ def get_locale():
7879
lang = request.accept_languages.best_match(support_language)
7980
return lang
8081

82+
signal.signal(
83+
signal.SIGINT, signal.SIG_DFL
84+
) # we add this to prevent SIGINT not work in multiprocess queue waiting
8185
babel = Babel(app, locale_selector=get_locale) # noqa:F841
8286
# Babel api from flask_babel v3.0.0
8387
api_call = create_api_call(args.logdir, args.model, args.cache_timeout)

0 commit comments

Comments
 (0)