1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-06 17:40:58 +00:00

fix: handle zero size (#1888)

This commit is contained in:
Jason Song 2023-07-11 11:35:27 +08:00 committed by GitHub
parent 28c6da4522
commit ab0f270c64
3 changed files with 24 additions and 11 deletions

View file

@ -311,10 +311,13 @@ func (h *Handler) commit(w http.ResponseWriter, r *http.Request, params httprout
db.Close()
if err := h.storage.Commit(cache.ID, cache.Size); err != nil {
size, err := h.storage.Commit(cache.ID, cache.Size)
if err != nil {
h.responseJSON(w, r, 500, err)
return
}
// write real size back to cache, it may be different from the current value when the request doesn't specify it.
cache.Size = size
db, err = h.openDB()
if err != nil {