Skip to content

Commit

Permalink
🎨 Update package struct
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jun 5, 2023
1 parent ed7609a commit 7ed0c13
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions actions/util/oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ func UploadOSS(key, contentType string, data []byte) (err error) {
sk := os.Getenv("QINIU_SK")

cfg := storage.Config{Zone: &storage.ZoneHuadong, UseCdnDomains: true, UseHTTPS: true}
//mac := qbox.NewMac(ak, sk)
//bucketManager := storage.NewBucketManager(mac, &cfg)
//stat, err := bucketManager.Stat(bucket, key)
//if nil != err {
// logger.Warnf("stat [%s] failed: %s", key, err)
//} else {
// if "" != stat.Hash {
// return
// }
//}
mac := qbox.NewMac(ak, sk)
bucketManager := storage.NewBucketManager(mac, &cfg)
stat, err := bucketManager.Stat(bucket, key)
if nil != err {
logger.Warnf("stat [%s] failed: %s", key, err)
} else {
if "" != stat.Hash {
return
}
}

putPolicy := storage.PutPolicy{
Scope: fmt.Sprintf("%s:%s", bucket, key), // overwrite if exists
Expand Down

0 comments on commit 7ed0c13

Please sign in to comment.