mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-25 14:26:58 +00:00
cache branch not found and only log error if error != NotFound
This commit is contained in:
parent
7526873049
commit
8c3b74518c
3 changed files with 18 additions and 2 deletions
|
@ -1,6 +1,8 @@
|
|||
package upstream
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"codeberg.org/codeberg/pages/server/gitea"
|
||||
|
@ -24,7 +26,9 @@ func GetBranchTimestamp(giteaClient *gitea.Client, owner, repo, branch string) *
|
|||
|
||||
timestamp, err := giteaClient.GiteaGetRepoBranchTimestamp(owner, repo, branch)
|
||||
if err != nil {
|
||||
log.Err(err).Msg("Could not get latest commit's timestamp from branch")
|
||||
if !errors.Is(err, gitea.ErrorNotFound) {
|
||||
log.Error().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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue