Commit efaa3669 authored by Shinya Maeda's avatar Shinya Maeda Committed by Alessio Caiazza

Change the order of status_sql to avoid the query for scheduled status at the earlier step

parent 70d015d1
...@@ -33,7 +33,6 @@ module HasStatus ...@@ -33,7 +33,6 @@ module HasStatus
warnings = scope_warnings.select('count(*) > 0').to_sql.presence || 'false' warnings = scope_warnings.select('count(*) > 0').to_sql.presence || 'false'
"(CASE "(CASE
WHEN (#{scheduled})>0 THEN 'scheduled'
WHEN (#{builds})=(#{skipped}) AND (#{warnings}) THEN 'success' WHEN (#{builds})=(#{skipped}) AND (#{warnings}) THEN 'success'
WHEN (#{builds})=(#{skipped}) THEN 'skipped' WHEN (#{builds})=(#{skipped}) THEN 'skipped'
WHEN (#{builds})=(#{success}) THEN 'success' WHEN (#{builds})=(#{success}) THEN 'success'
...@@ -43,6 +42,7 @@ module HasStatus ...@@ -43,6 +42,7 @@ module HasStatus
WHEN (#{builds})=(#{created})+(#{skipped})+(#{pending}) THEN 'pending' WHEN (#{builds})=(#{created})+(#{skipped})+(#{pending}) THEN 'pending'
WHEN (#{running})+(#{pending})>0 THEN 'running' WHEN (#{running})+(#{pending})>0 THEN 'running'
WHEN (#{manual})>0 THEN 'manual' WHEN (#{manual})>0 THEN 'manual'
WHEN (#{scheduled})>0 THEN 'scheduled'
WHEN (#{created})>0 THEN 'running' WHEN (#{created})>0 THEN 'running'
ELSE 'failed' ELSE 'failed'
END)" END)"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment