diff --git a/cmd/external-repos/main.go b/cmd/external-repos/main.go index ad6f827dd..cada5dea0 100644 --- a/cmd/external-repos/main.go +++ b/cmd/external-repos/main.go @@ -7,6 +7,7 @@ import ( "sort" "time" + "github.com/content-services/content-sources-backend/pkg/api" "github.com/content-services/content-sources-backend/pkg/config" "github.com/content-services/content-sources-backend/pkg/dao" "github.com/content-services/content-sources-backend/pkg/db" @@ -87,6 +88,7 @@ func main() { } if config.Get().Features.Snapshots.Enabled { waitForPulp() + debugIssue() err := enqueueSyncRepos(&urls) if err != nil { log.Warn().Msgf("Error enqueuing snapshot tasks: %v", err) @@ -194,6 +196,23 @@ func enqueueIntrospectAllRepos() error { return nil } +func debugIssue() { + repoConfigDao := dao.GetRepositoryConfigDao(db.DB) + repoConfigs, err := repoConfigDao.InternalOnly_ListReposToSnapshot(nil) + log.Error().Msgf("Found %v repoconfigs", len(repoConfigs)) + if err != nil { + log.Error().Err(err).Msg("error getting repository configurations") + } + for _, repoConfig := range repoConfigs { + log.Warn().Msgf("Repository: %v", repoConfig.Name) + } + _, count, err := dao.GetRepositoryDao(db.DB).ListPublic(api.PaginationData{}, api.FilterData{}) + if err != nil { + log.Error().Err(err).Msg("error getting public repos") + } + log.Error().Msgf("Found %v public repos", count) +} + func enqueueSyncRepos(urls *[]string) error { q, err := queue.NewPgQueue(db.GetUrl()) if err != nil {