Skip to content

Commit

Permalink
log list of bundles to retry
Browse files Browse the repository at this point in the history
  • Loading branch information
karlprieb committed Jan 14, 2025
1 parent 9b6e6f1 commit 088c79b
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/database/sql/bundles/repair.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,19 @@ FROM (
)

-- updateFullyIndexedAt
UPDATE bundles
SET
first_fully_indexed_at = IFNULL(first_fully_indexed_at, @fully_indexed_at),
last_fully_indexed_at = @fully_indexed_at
WHERE matched_data_item_count IS NOT NULL
AND matched_data_item_count > 0
AND EXISTS (
SELECT 1
FROM bundle_data_items bdi
WHERE bdi.parent_id = bundles.id
AND bdi.filter_id = bundles.index_filter_id
GROUP BY bdi.parent_id
HAVING COUNT(*) = bundles.matched_data_item_count
) AND last_fully_indexed_at IS NULL
UPDATE bundles
SET
first_fully_indexed_at = IFNULL(first_fully_indexed_at, @fully_indexed_at),
last_fully_indexed_at = @fully_indexed_at
WHERE matched_data_item_count IS NOT NULL
AND matched_data_item_count > 0
AND (
SELECT COUNT(*)
FROM bundle_data_items bdi
WHERE bdi.parent_id = bundles.id
AND bdi.filter_id = bundles.index_filter_id
) = bundles.matched_data_item_count
AND last_fully_indexed_at IS NULL;

-- updateForFilterChange
UPDATE bundles
Expand Down

0 comments on commit 088c79b

Please sign in to comment.