aboutsummaryrefslogtreecommitdiffstats
path: root/modules/cron/tasks.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/cron/tasks.go')
-rw-r--r--modules/cron/tasks.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/cron/tasks.go b/modules/cron/tasks.go
index a97326bd0f..6f3a96fd3f 100644
--- a/modules/cron/tasks.go
+++ b/modules/cron/tasks.go
@@ -98,8 +98,10 @@ func (t *Task) RunWithUser(doer *models.User, config Config) {
}
return
}
- if err := models.CreateNotice(models.NoticeTask, config.FormatMessage(t.Name, "finished", doer)); err != nil {
- log.Error("CreateNotice: %v", err)
+ if config.DoNoticeOnSuccess() {
+ if err := models.CreateNotice(models.NoticeTask, config.FormatMessage(t.Name, "finished", doer)); err != nil {
+ log.Error("CreateNotice: %v", err)
+ }
}
})
}