Preserve webserver from wasting time in re-constructing output message for RfCs
This commit is contained in:
@ -40,12 +40,17 @@
|
|||||||
- output_runs.each do |testrun|
|
- output_runs.each do |testrun|
|
||||||
- output = testrun.try(:output)
|
- output = testrun.try(:output)
|
||||||
- if output
|
- if output
|
||||||
|
- puts output
|
||||||
|
- begin
|
||||||
|
- Timeout::timeout(2) do
|
||||||
// (?:\\"|.) is required to correctly identify " within the output.
|
// (?:\\"|.) is required to correctly identify " within the output.
|
||||||
- messages = output.scan(/{(?:(?:"(?:\\"|.)+?":"(?:\\"|.)+?")+?,?)+}/)
|
// The outer (?: |\d+?) is used to correctly identify integers within the JSON
|
||||||
|
- messages = output.scan(/{(?:(?:"(?:\\"|.)+?":(?:"(?:\\"|.)+?"|\d+?|\[.*?\]))+?,?)+}/)
|
||||||
- messages.map! {|el| JSON.parse(el)}
|
- messages.map! {|el| JSON.parse(el)}
|
||||||
- messages.keep_if {|message| message['cmd'] == 'write'}
|
- messages.keep_if {|message| message['cmd'] == 'write'}
|
||||||
- messages.map! {|message| message['data']}
|
- messages.map! {|message| message['data']}
|
||||||
- output = messages.join ''
|
- output = messages.join ''
|
||||||
|
- rescue Timeout::Error
|
||||||
pre= output or t('request_for_comments.no_output')
|
pre= output or t('request_for_comments.no_output')
|
||||||
|
|
||||||
- assess_runs = testruns.select {|run| run.cause == 'assess'}
|
- assess_runs = testruns.select {|run| run.cause == 'assess'}
|
||||||
|
Reference in New Issue
Block a user