mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-21 22:42:49 +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
|
||||
}
|
||||
|
||||
|
||||
@@ -253,11 +253,12 @@ func (self *GuestDeleteTask) OnGuestDeleteComplete(ctx context.Context, obj db.I
|
||||
}
|
||||
|
||||
func (self *GuestDeleteTask) DeleteGuest(ctx context.Context, guest *models.SGuest) {
|
||||
isPendingDeleted := guest.PendingDeleted
|
||||
guest.RealDelete(ctx, self.UserCred)
|
||||
guest.RemoveAllMetadata(ctx, self.UserCred)
|
||||
db.OpsLog.LogEvent(guest, db.ACT_DELOCATE, nil, self.UserCred)
|
||||
logclient.AddActionLog(guest, logclient.ACT_DELETE, nil, self.UserCred, true)
|
||||
if !guest.IsSystem && !guest.PendingDeleted {
|
||||
if !guest.IsSystem && !isPendingDeleted {
|
||||
self.NotifyServerDeleted(ctx, guest)
|
||||
}
|
||||
models.HostManager.ClearSchedDescCache(guest.HostId)
|
||||
|
||||
1
pkg/hostman/diskhandlers/doc.go
Normal file
1
pkg/hostman/diskhandlers/doc.go
Normal file
@@ -0,0 +1 @@
|
||||
package diskhandlers // import "yunion.io/x/onecloud/pkg/hostman/diskhandlers"
|
||||
1
pkg/hostman/guesthandlers/doc.go
Normal file
1
pkg/hostman/guesthandlers/doc.go
Normal file
@@ -0,0 +1 @@
|
||||
package guesthandlers // import "yunion.io/x/onecloud/pkg/hostman/guesthandlers"
|
||||
Reference in New Issue
Block a user