Skip to content

Commit 12ca140

Browse files
committed
always accept :cancel and :restart, no matter the state update count
1 parent 92819fd commit 12ca140

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/travis/hub/service/state_update.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def key
2424

2525
include Helper::Context
2626

27+
OUT_OF_BAND = [:cancel, :restart]
28+
2729
MSGS = {
2830
missing: 'Received state update (%p) with no count for job id=%p, last known count: %p.',
2931
ordered: 'Received state update %p (%p) for job id=%p, last known count: %p',
@@ -32,6 +34,7 @@ def key
3234
}
3335

3436
def apply?
37+
return true if out_of_band?
3538
return missing unless given?
3639
apply = ordered? ? ordered : unordered
3740
return true unless ENV['UPDATE_COUNT']
@@ -40,6 +43,10 @@ def apply?
4043

4144
private
4245

46+
def out_of_band?
47+
OUT_OF_BAND.include?(event)
48+
end
49+
4350
def given?
4451
!count.nil?
4552
end

0 commit comments

Comments
 (0)