MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / SaveAlertLog

Function SaveAlertLog

agent/utils/alert/alert.go:131–143  ·  view source on GitHub ↗
(create dto.AlertLogCreate, alertLog *model.AlertLog)

Source from the content-addressed store, hash-verified

129}
130
131func SaveAlertLog(create dto.AlertLogCreate, alertLog *model.AlertLog) error {
132 alertRepo := repo.NewIAlertRepo()
133 if err := copier.Copy(&alertLog, &create); err != nil {
134 return buserr.WithErr("ErrStructTransform", err)
135 }
136
137 if err := alertRepo.CreateLog(alertLog); err != nil {
138 global.LOG.Errorf("Error creating alert logs, err: %v", err)
139 return err
140 }
141
142 return nil
143}
144
145func CreateNewAlertTask(quota, alertType, quotaType, method string) {
146 alertRepo := repo.NewIAlertRepo()

Callers 2

CreateEmailAlertLogFunction · 0.85
CreateBarkAlertLogFunction · 0.85

Calls 2

CreateLogMethod · 0.95
CopyMethod · 0.80

Tested by

no test coverage detected