@@ -158,13 +158,9 @@ func (s *PipelineGC) cleanupUpgrade() error {
158
158
}
159
159
160
160
func (s * PipelineGC ) cleanupMK12DealPipeline () error {
161
- // Remove market_mk12_deal_pipeline entries where:
162
- // sealed is true and indexed is true
163
161
ctx := context .Background ()
164
162
165
- // Execute the query
166
- // NOTE: pipelines can be complete before indexing finishes in case of reindexing pipeline tasks (created in CheckIndex task)
167
- _ , err := s .db .Exec (ctx , `DELETE FROM market_mk12_deal_pipeline WHERE (should_index = FALSE OR indexed = TRUE) AND complete = TRUE;` )
163
+ _ , err := s .db .Exec (ctx , `DELETE FROM market_mk12_deal_pipeline WHERE complete = TRUE;` )
168
164
if err != nil {
169
165
return xerrors .Errorf ("failed to clean up sealed deals: %w" , err )
170
166
}
@@ -177,6 +173,24 @@ func (s *PipelineGC) cleanupMK12DealPipeline() error {
177
173
return nil
178
174
}
179
175
176
+ func (s * PipelineGC ) cleanupMK20DealPipeline () error {
177
+ ctx := context .Background ()
178
+
179
+ _ , err := s .db .Exec (ctx , `DELETE FROM market_mk20_offline_urls
180
+ WHERE id IN (
181
+ SELECT id FROM market_mk20_pipeline WHERE complete = TRUE
182
+ );
183
+
184
+ DELETE FROM market_mk20_pipeline
185
+ WHERE complete = TRUE;
186
+ ` )
187
+ if err != nil {
188
+ return xerrors .Errorf ("failed to clean up sealed deals: %w" , err )
189
+ }
190
+
191
+ return nil
192
+ }
193
+
180
194
func (s * PipelineGC ) cleanupUnseal () error {
181
195
// Remove sectors_unseal_pipeline entries where:
182
196
// after_unseal_sdr is true
0 commit comments