Description:
added termination reporting to grader (using at_exit)
git-svn-id: http://theory.cpe.ku.ac.th/grader/judge/trunk/scripts@377 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r70:347e4eeef742 - - 1 file changed: 8 inserted, 3 deleted
@@ -125,12 +125,20 | |||||
|
125 | grader_proc = nil |
|
125 | grader_proc = nil |
|
126 | end |
|
126 | end |
|
127 |
|
127 | ||
|
128 | #set loggin environment |
|
128 | #set loggin environment |
|
129 | ENV['GRADER_LOGGING'] = log_file_name |
|
129 | ENV['GRADER_LOGGING'] = log_file_name |
|
130 |
|
130 | ||
|
|
131 | + # register exit handler to report inactive, and terminated | ||
|
|
132 | + at_exit do | ||
|
|
133 | + if grader_proc!=nil | ||
|
|
134 | + grader_proc.report_inactive | ||
|
|
135 | + grader_proc.terminate | ||
|
|
136 | + end | ||
|
|
137 | + end | ||
|
|
138 | + | ||
|
131 | # |
|
139 | # |
|
132 | # MAIN LOOP |
|
140 | # MAIN LOOP |
|
133 | # |
|
141 | # |
|
134 |
|
142 | ||
|
135 | case grader_mode |
|
143 | case grader_mode |
|
136 | when "queue", "test_request" |
|
144 | when "queue", "test_request" |
@@ -204,9 +212,6 | |||||
|
204 |
|
212 | ||
|
205 | else |
|
213 | else |
|
206 | display_manual |
|
214 | display_manual |
|
207 | exit(0) |
|
215 | exit(0) |
|
208 | end |
|
216 | end |
|
209 |
|
217 | ||
|
210 | - # report inactive |
|
||
|
211 | - grader_proc.report_inactive if grader_proc!=nil |
|
||
|
212 | - |
|
You need to be logged in to leave comments.
Login now