fix(glance): avoid receive notify when glance restart (#25409)

This commit is contained in:
屈轩
2026-08-24 15:05:04 +08:00
committed by GitHub
parent bd3e8d0d97
commit 923053aa4d
+8 -6
View File
@@ -2181,12 +2181,14 @@ func (img *SImage) Pipeline(ctx context.Context, userCred mcclient.TokenCredenti
if err == nil {
kwargs.Set("os_type", jsonutils.NewString(osType.Value))
}
notifyclient.SystemNotifyWithCtx(ctx, notify.NotifyPriorityNormal, notifyclient.IMAGE_ACTIVED, kwargs)
notifyclient.NotifyImportantWithCtx(ctx, []string{userCred.GetUserId()}, false, notifyclient.IMAGE_ACTIVED, kwargs)
notifyclient.EventNotify(ctx, userCred, notifyclient.SEventNotifyParam{
Obj: img,
Action: notifyclient.ActionCreate,
})
if !skipProbe {
notifyclient.SystemNotifyWithCtx(ctx, notify.NotifyPriorityNormal, notifyclient.IMAGE_ACTIVED, kwargs)
notifyclient.NotifyImportantWithCtx(ctx, []string{userCred.GetUserId()}, false, notifyclient.IMAGE_ACTIVED, kwargs)
notifyclient.EventNotify(ctx, userCred, notifyclient.SEventNotifyParam{
Obj: img,
Action: notifyclient.ActionCreate,
})
}
}
return nil
}