mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-04 06:25:32 +00:00
1. Replace bolthold with direct bbolt access in the cache server. bolthold has not changed since March 2024 and kept `encoding/gob` in the binary although the store was already JSON. The on-disk layout stays the same, so existing caches keep working, and the index buckets bolthold left behind are dropped on the first sweep. Queries now run against an in-memory copy of the entries that is only re-read after another process wrote to the store, so lookups and sweeps no longer decode the whole store. 2. Replace gofakes3 with a small in-memory S3 fake in the one test that used it, which removes aws-sdk-go-v2, afero, mgo and x/tools from the module graph. Reviewed-on: https://gitea.com/gitea/runner/pulls/1336 Reviewed-by: bircni <[email protected]> Co-authored-by: silverwind <[email protected]>
24 lines
699 B
Go
24 lines
699 B
Go
// Copyright 2023 The Gitea Authors. All rights reserved.
|
|
// Copyright 2023 The nektos/act Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package artifactcache
|
|
|
|
type Request struct {
|
|
Key string `json:"key" `
|
|
Version string `json:"version"`
|
|
Size int64 `json:"cacheSize"`
|
|
}
|
|
|
|
type Cache struct {
|
|
ID uint64 `json:"id"`
|
|
Repo string `json:"repo"`
|
|
Key string `json:"key"`
|
|
Version string `json:"version"`
|
|
Size int64 `json:"cacheSize"`
|
|
Owner string `json:"owner"` // hashed bearer, so a job's own retry is not another job's reservation
|
|
Complete bool `json:"complete"`
|
|
UsedAt int64 `json:"usedAt"`
|
|
CreatedAt int64 `json:"createdAt"`
|
|
}
|