mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
minor fixes
This commit is contained in:
@@ -24,6 +24,7 @@ var (
|
||||
|
||||
func init() {
|
||||
notifyClientWorkerMan = appsrv.NewWorkerManager("NotifyClientWorkerManager", 1, 50, false)
|
||||
templatesTable = make(map[string]*template.Template)
|
||||
}
|
||||
|
||||
func getTemplateString(topic string, contType string, channel notify.TNotifyChannel) ([]byte, error) {
|
||||
@@ -59,11 +60,12 @@ func getContent(topic string, contType string, data jsonutils.JSONObject) (strin
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
var buf *strings.Builder
|
||||
err = tmpl.Execute(buf, data.Interface())
|
||||
buf := strings.Builder{}
|
||||
err = tmpl.Execute(&buf, data.Interface())
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
log.Debugf("notify.getContent %s %s %s %s", topic, contType, data, buf.String())
|
||||
return buf.String(), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user