mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-25 14:26:58 +00:00
fix lint issues and tests
This commit is contained in:
parent
dc023b81a8
commit
ea13ac0e92
7 changed files with 27 additions and 33 deletions
|
@ -30,8 +30,8 @@ var (
|
|||
// fileCacheTimeout specifies the timeout for the file content cache - you might want to make this quite long, depending
|
||||
// on your available memory.
|
||||
// TODO: move as option into cache interface
|
||||
fileCacheTimeout = 5 * time.Minute
|
||||
// fileCacheTimeout = 5 * time.Minute
|
||||
|
||||
// fileCacheSizeLimit limits the maximum file size that will be cached, and is set to 1 MB by default.
|
||||
fileCacheSizeLimit = 1024 * 1024
|
||||
// fileCacheSizeLimit = 1024 * 1024
|
||||
)
|
||||
|
|
|
@ -139,7 +139,9 @@ func (client *Client) GiteaGetRepoBranchTimestamp(repoOwner, repoName, branchNam
|
|||
Timestamp: branch.Commit.Timestamp,
|
||||
}
|
||||
|
||||
client.responseCache.Set(cacheKey, stamp, branchExistenceCacheTimeout)
|
||||
if err := client.responseCache.Set(cacheKey, stamp, branchExistenceCacheTimeout); err != nil {
|
||||
log.Error().Err(err).Msgf("error on store of repo branch timestamp [%s/%s@%s]", repoOwner, repoName, branchName)
|
||||
}
|
||||
return stamp, nil
|
||||
}
|
||||
|
||||
|
@ -159,6 +161,8 @@ func (client *Client) GiteaGetRepoDefaultBranch(repoOwner, repoName string) (str
|
|||
}
|
||||
|
||||
branch := repo.DefaultBranch
|
||||
client.responseCache.Set(cacheKey, branch, defaultBranchCacheTimeout)
|
||||
if err := client.responseCache.Set(cacheKey, branch, defaultBranchCacheTimeout); err != nil {
|
||||
log.Error().Err(err).Msgf("error on store of repo default branch [%s/%s]", repoOwner, repoName)
|
||||
}
|
||||
return branch, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue