mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
minor fixes
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
type SResourceBase struct {
|
||||
SModelBase
|
||||
|
||||
CreatedAt time.Time `nullable:"false" created_at:"true" get:"user" list:"user"`
|
||||
CreatedAt time.Time `nullable:"false" created_at:"true" index:"true" get:"user" list:"user"`
|
||||
UpdatedAt time.Time `nullable:"false" updated_at:"true" list:"user"`
|
||||
UpdateVersion int `default:"0" nullable:"false" auto_version:"true" list:"user"`
|
||||
DeletedAt time.Time ``
|
||||
|
||||
@@ -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