This commit is contained in:
Denis Gukov 2022-02-03 23:35:32 +05:00
parent 5185fa4067
commit 95e891cdd8
3 changed files with 4 additions and 4 deletions

View File

@ -10,5 +10,5 @@ type Project struct {
Name string `db:"name" json:"name" binding:"required"`
Created time.Time `db:"created" json:"created"`
Alert bool `db:"alert" json:"alert"`
AlertChat string `db:"alert_chat" json:"alert_chat"`
AlertChat *string `db:"alert_chat" json:"alert_chat"`
}

View File

@ -72,8 +72,8 @@ func (t *TaskRunner) sendTelegramAlert() {
}
chatID := util.Config.TelegramChat
if t.alertChat != "" {
chatID = t.alertChat
if t.alertChat != nil && *t.alertChat != "" {
chatID = *t.alertChat
}
var telegramBuffer bytes.Buffer

View File

@ -31,7 +31,7 @@ type TaskRunner struct {
users []int
hosts []string
alertChat string
alertChat *string
alert bool
prepared bool
process *os.Process