Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
55bfa74f
Commit
55bfa74f
authored
Apr 14, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change timeout handling code to wait while getting from the Queue
parent
5175c2dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
dream/platform/__init__.py
dream/platform/__init__.py
+6
-5
No files found.
dream/platform/__init__.py
View file @
55bfa74f
...
...
@@ -25,6 +25,7 @@ import urllib
import
xlrd
import
traceback
import
multiprocessing
import
Queue
from
dream.KnowledgeExtraction.DistributionFitting
import
DistFittest
from
dream.KnowledgeExtraction.ImportExceldata
import
Import_Excel
...
...
@@ -105,13 +106,13 @@ def runWithTimeout(func, timeout, *args, **kw):
target
=
_runWithTimeout
,
args
=
(
queue
,
func
,
args
,
kw
))
process
.
start
()
process
.
join
(
timeout
)
if
process
.
is_alive
():
# process still alive after timeout, terminate it
try
:
return
queue
.
get
(
timeout
=
timeout
)
except
Queue
.
Empty
:
process
.
terminate
()
process
.
join
()
raise
TimeoutError
()
return
queue
.
get
()
finally
:
process
.
join
()
def
_runWithTimeout
(
queue
,
func
,
args
,
kw
):
import
signal
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment