add debugging from 091e6c8ed9 back

This commit is contained in:
6543 2022-09-18 19:50:41 +02:00
parent bcb7d773d1
commit 9626d3a8a0
No known key found for this signature in database
GPG Key ID: B8BE6D610E61C862

View File

@ -19,17 +19,19 @@ func GetBranchTimestamp(giteaClient *gitea.Client, owner, repo, branch string) *
// Get default branch
defaultBranch, err := giteaClient.GiteaGetRepoDefaultBranch(owner, repo)
if err != nil {
log.Error().Err(err).Msg("GiteaGetRepoDefaultBranch")
log.Err(err).Msg("Could't fetch default branch from repository")
return nil
}
log.Debug().Msgf("found default branch: %s", defaultBranch)
branch = defaultBranch
}
timestamp, err := giteaClient.GiteaGetRepoBranchTimestamp(owner, repo, branch)
if err != nil {
log.Error().Err(err).Msg("GiteaGetRepoBranchTimestamp")
log.Err(err).Msg("Could not get latest commit's timestamp from branch")
return nil
}
log.Debug().Msgf("Succesfully fetched latest commit's timestamp from branch: %#v", timestamp)
return timestamp
}