This commit is contained in:
crapStone 2024-11-21 22:35:08 +01:00
parent 81bdbaf261
commit 92c88cff03
No known key found for this signature in database
GPG key ID: 22D4BF0CF7CC29C8
3 changed files with 1 additions and 7 deletions

View file

@ -130,10 +130,8 @@ func (client *Client) ServeRawContent(targetOwner, targetRepo, ref, resource str
return nil, nil, http.StatusInternalServerError, ErrorNotFound
}
cache.Body = body.([]byte)
// TODO: don't grab the content from the cache if the ETag matches?!
cachedHeader, cachedStatusCode := cache.createHttpResponse(cacheKey)
// TODO: check against some timestamp mismatch?!?
if cache.Exists {
if cache.IsSymlink {
linkDest := string(cache.Body)
@ -147,7 +145,6 @@ func (client *Client) ServeRawContent(targetOwner, targetRepo, ref, resource str
return nil, nil, http.StatusNotFound, ErrorNotFound
}
}
// TODO: metadata not written, is close ever called?
log.Trace().Msg("file not in cache")
// not in cache, open reader via gitea api
reader, resp, err := client.sdkClient.GetFileReader(targetOwner, targetRepo, ref, resource, client.supportLFS)