mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-11 17:50:58 +00:00
fix: handle zero size (#1888)
This commit is contained in:
parent
28c6da4522
commit
ab0f270c64
3 changed files with 24 additions and 11 deletions
|
@ -15,11 +15,17 @@ func (c *Request) ToCache() *Cache {
|
|||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return &Cache{
|
||||
ret := &Cache{
|
||||
Key: c.Key,
|
||||
Version: c.Version,
|
||||
Size: c.Size,
|
||||
}
|
||||
if c.Size == 0 {
|
||||
// So the request comes from old versions of actions, like `actions/cache@v2`.
|
||||
// It doesn't send cache size. Set it to -1 to indicate that.
|
||||
ret.Size = -1
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
type Cache struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue