2
2
require 'pact_broker/matrix/row'
3
3
require 'pact_broker/matrix/latest_row'
4
4
require 'pact_broker/matrix/head_row'
5
+ require 'pact_broker/matrix/refresh_head_matrix_job'
5
6
require 'pact_broker/error'
6
7
8
+
7
9
module PactBroker
8
10
module Matrix
9
11
@@ -23,7 +25,7 @@ class Repository
23
25
24
26
def refresh params
25
27
PactBroker ::Matrix ::Row . refresh ( params )
26
- PactBroker :: Matrix :: HeadRow . refresh ( params )
28
+ RefreshHeadMatrixJob . perform_in ( 1 , params : params )
27
29
end
28
30
29
31
# Return the latest matrix row (pact/verification) for each consumer_version_number/provider_version_number
@@ -128,11 +130,13 @@ def look_up_versions_for_latest_and_tag(selectors, options)
128
130
end
129
131
end . collect do | selector |
130
132
if selector [ :pacticipant_name ]
131
- selector [ :pacticipant_id ] = PactBroker ::Domain ::Pacticipant . find ( name : selector [ :pacticipant_name ] ) . id
133
+ pacticipant = PactBroker ::Domain ::Pacticipant . find ( name : selector [ :pacticipant_name ] )
134
+ selector [ :pacticipant_id ] = pacticipant ? pacticipant . id : nil
132
135
end
133
136
134
137
if selector [ :pacticipant_name ] && selector [ :pacticipant_version_number ]
135
- selector [ :pacticipant_version_id ] = version_repository . find_by_pacticipant_name_and_number ( selector [ :pacticipant_name ] , selector [ :pacticipant_version_number ] ) . id
138
+ version = version_repository . find_by_pacticipant_name_and_number ( selector [ :pacticipant_name ] , selector [ :pacticipant_version_number ] )
139
+ selector [ :pacticipant_version_id ] = version ? version . id : nil
136
140
end
137
141
138
142
if selector [ :pacticipant_version_number ] . nil?
0 commit comments