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 | 125 | grader_proc = nil |
|
126 | 126 | end |
|
127 | 127 | |
|
128 | 128 | #set loggin environment |
|
129 | 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 | 140 | # MAIN LOOP |
|
133 | 141 | # |
|
134 | 142 | |
|
135 | 143 | case grader_mode |
|
136 | 144 | when "queue", "test_request" |
@@ -204,9 +212,6 | |||
|
204 | 212 | |
|
205 | 213 | else |
|
206 | 214 | display_manual |
|
207 | 215 | exit(0) |
|
208 | 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