MM-16796: reduce plugin job interval to once per day (#11521)
* MM-16796: reduce plugin job interval to once per day The Jobs infrastructure isn't currently setup for running frequent jobs, as it spams the Jobs table with useless records. Update the plugin job interval to run less frequently -- since the cleanup doesn't affect semantics anyway -- and clean up the previously created entries in the Jobs table.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8d100af052
Коммит
0d05fe32af
@@ -11,6 +11,8 @@ import (
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
)
|
||||
|
||||
const pluginsJobInterval = 24 * 60 * 60 * time.Second
|
||||
|
||||
type Scheduler struct {
|
||||
App *app.App
|
||||
}
|
||||
@@ -32,7 +34,7 @@ func (scheduler *Scheduler) Enabled(cfg *model.Config) bool {
|
||||
}
|
||||
|
||||
func (scheduler *Scheduler) NextScheduleTime(cfg *model.Config, now time.Time, pendingJobs bool, lastSuccessfulJob *model.Job) *time.Time {
|
||||
nextTime := time.Now().Add(60 * time.Second)
|
||||
nextTime := time.Now().Add(pluginsJobInterval)
|
||||
return &nextTime
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user