Skip to content

codeintel: Add RepositoryIDsForRetentionScan

Administrator requested to merge ef/retention-repo-scan into main

Created by: efritz

This PR adds the RepositoryIDsForRetentionScan method to dbstore. This method will be used when comparing upload records against data retention policies.

The worker will have the following rough outline:

for {
    repositories, err := dbStore.RepositoryIDsForRetentionScan(ctx, time.Hour * 24, 100)
    if err != nil { /* ... */ }

    for _, repository := range repositories {
        // handle repository
    }

    // small sleep
}

This snippet ensures that a set of up to 100 upload records that haven't been processed within 24 hours are dequeued and immediately marked as processed.

Merge request reports

Loading