mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 02:59:16 +08:00
parent
1858cb4df8
commit
bfa667584a
@ -249,15 +249,17 @@ func (c *ClamService) Update(req dto.ClamUpdate) error {
|
|||||||
if err := clamRepo.Update(req.ID, upMap); err != nil {
|
if err := clamRepo.Update(req.ID, upMap); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
updateAlert := dto.CreateOrUpdateAlert{
|
if req.AlertCount != 0 {
|
||||||
AlertTitle: req.AlertTitle,
|
updateAlert := dto.CreateOrUpdateAlert{
|
||||||
AlertType: "clams",
|
AlertTitle: req.AlertTitle,
|
||||||
AlertCount: req.AlertCount,
|
AlertType: "clams",
|
||||||
EntryID: clam.ID,
|
AlertCount: req.AlertCount,
|
||||||
}
|
EntryID: clam.ID,
|
||||||
err := xpack.UpdateAlert(updateAlert)
|
}
|
||||||
if err != nil {
|
err := xpack.UpdateAlert(updateAlert)
|
||||||
return err
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -316,15 +316,17 @@ func (u *CronjobService) Update(id uint, req dto.CronjobUpdate) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
updateAlert := dto.CreateOrUpdateAlert{
|
if req.AlertCount != 0 {
|
||||||
AlertTitle: req.AlertTitle,
|
updateAlert := dto.CreateOrUpdateAlert{
|
||||||
AlertType: cronModel.Type,
|
AlertTitle: req.AlertTitle,
|
||||||
AlertCount: req.AlertCount,
|
AlertType: cronModel.Type,
|
||||||
EntryID: cronModel.ID,
|
AlertCount: req.AlertCount,
|
||||||
}
|
EntryID: cronModel.ID,
|
||||||
err = xpack.UpdateAlert(updateAlert)
|
}
|
||||||
if err != nil {
|
err = xpack.UpdateAlert(updateAlert)
|
||||||
return err
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user