@@ -18,10 +18,10 @@ import (
18
18
"time"
19
19
20
20
"github.com/aws/aws-sdk-go-v2/service/s3"
21
- "github.com/aws/aws-sdk-go-v2/service/s3/types"
22
21
"github.com/creachadair/gocache"
23
22
"github.com/creachadair/gocache/cachedir"
24
23
"github.com/creachadair/taskgroup"
24
+ "github.com/tailscale/go-cache-plugin/internal/s3util"
25
25
)
26
26
27
27
// Cache implements callbacks for a gocache.Server using an S3 bucket for
@@ -110,7 +110,7 @@ func (s *Cache) Get(ctx context.Context, actionID string) (objectID, diskPath st
110
110
Key : s .actionKey (actionID ),
111
111
})
112
112
if err != nil {
113
- if isNotExist (err ) {
113
+ if s3util . IsNotExist (err ) {
114
114
s .getFaultMiss .Add (1 )
115
115
return "" , "" , nil // cache miss, OK
116
116
}
@@ -277,18 +277,6 @@ func (s *Cache) uploadConcurrency() int {
277
277
return s .UploadConcurrency
278
278
}
279
279
280
- func isNotExist (err error ) bool {
281
- var notFound * types.NotFound
282
- if errors .As (err , & notFound ) {
283
- return true
284
- }
285
- var noSuchKey * types.NoSuchKey
286
- if errors .As (err , & noSuchKey ) {
287
- return true
288
- }
289
- return errors .Is (err , os .ErrNotExist )
290
- }
291
-
292
280
func parseAction (r io.Reader ) (objectID string , mtime time.Time , _ error ) {
293
281
data , err := io .ReadAll (r )
294
282
if err != nil {
0 commit comments