aboutsummaryrefslogtreecommitdiffstats
path: root/modules/cron/setting.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/cron/setting.go')
-rw-r--r--modules/cron/setting.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/cron/setting.go b/modules/cron/setting.go
index dd93d03986..5fe9ca6e14 100644
--- a/modules/cron/setting.go
+++ b/modules/cron/setting.go
@@ -17,13 +17,15 @@ type Config interface {
DoRunAtStart() bool
GetSchedule() string
FormatMessage(name, status string, doer *models.User, args ...interface{}) string
+ DoNoticeOnSuccess() bool
}
// BaseConfig represents the basic config for a Cron task
type BaseConfig struct {
- Enabled bool
- RunAtStart bool
- Schedule string
+ Enabled bool
+ RunAtStart bool
+ Schedule string
+ NoSuccessNotice bool
}
// OlderThanConfig represents a cron task with OlderThan setting
@@ -53,6 +55,11 @@ func (b *BaseConfig) DoRunAtStart() bool {
return b.RunAtStart
}
+// DoNoticeOnSuccess returns whether a success notice should be posted
+func (b *BaseConfig) DoNoticeOnSuccess() bool {
+ return !b.NoSuccessNotice
+}
+
// FormatMessage returns a message for the task
func (b *BaseConfig) FormatMessage(name, status string, doer *models.User, args ...interface{}) string {
realArgs := make([]interface{}, 0, len(args)+2)