summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/platform/model/job.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-02-09 00:11:04 +0100
committerWim <wim@42.be>2018-02-09 00:11:04 +0100
commit5aab158c0b0db64b6136fe2fdaca8b8e9e3bd811 (patch)
tree09bcb3f02f968867c2ca84db1f28594dd0afb967 /vendor/github.com/mattermost/platform/model/job.go
parent1d33e60e36fa7b0e361990ac347ee8d620d67dcc (diff)
downloadmatterbridge-msglm-5aab158c0b0db64b6136fe2fdaca8b8e9e3bd811.tar.gz
matterbridge-msglm-5aab158c0b0db64b6136fe2fdaca8b8e9e3bd811.tar.bz2
matterbridge-msglm-5aab158c0b0db64b6136fe2fdaca8b8e9e3bd811.zip
Update vendor (github.com/mattermost)
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/job.go')
-rw-r--r--vendor/github.com/mattermost/platform/model/job.go36
1 files changed, 23 insertions, 13 deletions
diff --git a/vendor/github.com/mattermost/platform/model/job.go b/vendor/github.com/mattermost/platform/model/job.go
index 004331a1..9a756602 100644
--- a/vendor/github.com/mattermost/platform/model/job.go
+++ b/vendor/github.com/mattermost/platform/model/job.go
@@ -7,11 +7,15 @@ import (
"encoding/json"
"io"
"net/http"
+ "time"
)
const (
- JOB_TYPE_DATA_RETENTION = "data_retention"
- JOB_TYPE_ELASTICSEARCH_POST_INDEXING = "elasticsearch_post_indexing"
+ JOB_TYPE_DATA_RETENTION = "data_retention"
+ JOB_TYPE_MESSAGE_EXPORT = "message_export"
+ JOB_TYPE_ELASTICSEARCH_POST_INDEXING = "elasticsearch_post_indexing"
+ JOB_TYPE_ELASTICSEARCH_POST_AGGREGATION = "elasticsearch_post_aggregation"
+ JOB_TYPE_LDAP_SYNC = "ldap_sync"
JOB_STATUS_PENDING = "pending"
JOB_STATUS_IN_PROGRESS = "in_progress"
@@ -22,15 +26,15 @@ const (
)
type Job struct {
- Id string `json:"id"`
- Type string `json:"type"`
- Priority int64 `json:"priority"`
- CreateAt int64 `json:"create_at"`
- StartAt int64 `json:"start_at"`
- LastActivityAt int64 `json:"last_activity_at"`
- Status string `json:"status"`
- Progress int64 `json:"progress"`
- Data map[string]interface{} `json:"data"`
+ Id string `json:"id"`
+ Type string `json:"type"`
+ Priority int64 `json:"priority"`
+ CreateAt int64 `json:"create_at"`
+ StartAt int64 `json:"start_at"`
+ LastActivityAt int64 `json:"last_activity_at"`
+ Status string `json:"status"`
+ Progress int64 `json:"progress"`
+ Data map[string]string `json:"data"`
}
func (j *Job) IsValid() *AppError {
@@ -45,6 +49,9 @@ func (j *Job) IsValid() *AppError {
switch j.Type {
case JOB_TYPE_DATA_RETENTION:
case JOB_TYPE_ELASTICSEARCH_POST_INDEXING:
+ case JOB_TYPE_ELASTICSEARCH_POST_AGGREGATION:
+ case JOB_TYPE_LDAP_SYNC:
+ case JOB_TYPE_MESSAGE_EXPORT:
default:
return NewAppError("Job.IsValid", "model.job.is_valid.type.app_error", nil, "id="+j.Id, http.StatusBadRequest)
}
@@ -112,6 +119,9 @@ type Worker interface {
}
type Scheduler interface {
- Run()
- Stop()
+ Name() string
+ JobType() string
+ Enabled(cfg *Config) bool
+ NextScheduleTime(cfg *Config, now time.Time, pendingJobs bool, lastSuccessfulJob *Job) *time.Time
+ ScheduleJob(cfg *Config, pendingJobs bool, lastSuccessfulJob *Job) (*Job, *AppError)
}