Skip to content

Commit

Permalink
Add debug to figure out timing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsherrill committed Nov 8, 2023
1 parent 2d37d7b commit 2ed90e1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cmd/external-repos/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2ed90e1

Please sign in to comment.