Merge remote-tracking branch 'origin/main' into test
# Conflicts: # internal/service/plugin_common/plugin_common_service.go
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
Apache Answer (incubating)
|
||||
Copyright 2023 The Apache Software Foundation
|
||||
Copyright 2023-2024 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (https://www.apache.org/).
|
||||
|
||||
@@ -32,6 +32,4 @@ swaggerui:
|
||||
host: 127.0.0.1
|
||||
address: ':80'
|
||||
service_config:
|
||||
secret_key: "answer"
|
||||
web_host: "http://127.0.0.1:9080"
|
||||
upload_path: "/data/uploads"
|
||||
|
||||
@@ -22,16 +22,19 @@ package plugin_common
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/apache/incubator-answer/internal/base/constant"
|
||||
|
||||
"github.com/apache/incubator-answer/internal/base/data"
|
||||
"github.com/apache/incubator-answer/internal/repo/search_sync"
|
||||
|
||||
"github.com/segmentfault/pacman/errors"
|
||||
"github.com/segmentfault/pacman/log"
|
||||
|
||||
"github.com/apache/incubator-answer/internal/base/constant"
|
||||
"github.com/apache/incubator-answer/internal/base/reason"
|
||||
"github.com/apache/incubator-answer/internal/entity"
|
||||
"github.com/apache/incubator-answer/internal/repo/search_sync"
|
||||
"github.com/apache/incubator-answer/internal/schema"
|
||||
"github.com/apache/incubator-answer/internal/service/config"
|
||||
"github.com/apache/incubator-answer/plugin"
|
||||
"github.com/segmentfault/pacman/errors"
|
||||
"github.com/segmentfault/pacman/log"
|
||||
)
|
||||
|
||||
type PluginConfigRepo interface {
|
||||
@@ -149,6 +152,14 @@ func (ps *PluginCommonService) initPluginData() {
|
||||
log.Errorf("parse plugin config failed: %s %v", pluginConfig.PluginSlugName, err)
|
||||
}
|
||||
}
|
||||
|
||||
err = plugin.CallCache(func(cache plugin.Cache) error {
|
||||
data.Cache = cache
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
log.Errorf("parse plugin cache failed: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// init plugin user config
|
||||
|
||||
Reference in New Issue
Block a user