This is an automated email from the ASF dual-hosted git repository.
kumfo pushed a commit to branch fix/cdn
in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git
The following commit(s) were added to refs/heads/fix/cdn by this push:
new 08f6033 fix(cdn): aliyun oss cdn add sync status check
08f6033 is described below
commit 08f60334d5b981c3964c49bb5d93620473070c8e
Author: kumfo <[email protected]>
AuthorDate: Fri Jul 19 15:48:01 2024 +0800
fix(cdn): aliyun oss cdn add sync status check
---
cdn-aliyunoss/aliyunoss.go | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/cdn-aliyunoss/aliyunoss.go b/cdn-aliyunoss/aliyunoss.go
index 150d11c..9001674 100644
--- a/cdn-aliyunoss/aliyunoss.go
+++ b/cdn-aliyunoss/aliyunoss.go
@@ -35,7 +35,10 @@ import (
"strings"
)
-var staticPath = os.Getenv("ANSWER_STATIC_PATH")
+var (
+ staticPath = os.Getenv("ANSWER_STATIC_PATH")
+ enable = false
+)
//go:embed info.yaml
var Info embed.FS
@@ -45,8 +48,6 @@ const (
defaultMaxFileSize int64 = 10 * 1024 * 1024
)
-var enable = false
-
type CDN struct {
Config *CDNConfig
}
@@ -216,6 +217,9 @@ func (c *CDN) scanEmbedFiles(fileName string) (err error) {
for _, info := range entry {
if info.IsDir() {
err = c.scanEmbedFiles(filepath.Join(fileName,
info.Name()))
+ if err != nil {
+ return
+ }
continue
}