From 4dd8bae5c91fa4aef09d865d8fef1acd84f90925 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 17 Oct 2021 00:47:22 +0200 Subject: Update dependencies (#1610) * Update dependencies * Update module to go 1.17 --- .../mattermost/mattermost-server/v5/model/job.go | 35 +++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'vendor/github.com/mattermost/mattermost-server/v5/model/job.go') diff --git a/vendor/github.com/mattermost/mattermost-server/v5/model/job.go b/vendor/github.com/mattermost/mattermost-server/v5/model/job.go index 072bfb2b..78d5a4ff 100644 --- a/vendor/github.com/mattermost/mattermost-server/v5/model/job.go +++ b/vendor/github.com/mattermost/mattermost-server/v5/model/job.go @@ -22,7 +22,12 @@ const ( JOB_TYPE_EXPIRY_NOTIFY = "expiry_notify" JOB_TYPE_PRODUCT_NOTICES = "product_notices" JOB_TYPE_ACTIVE_USERS = "active_users" + JOB_TYPE_IMPORT_PROCESS = "import_process" + JOB_TYPE_IMPORT_DELETE = "import_delete" + JOB_TYPE_EXPORT_PROCESS = "export_process" + JOB_TYPE_EXPORT_DELETE = "export_delete" JOB_TYPE_CLOUD = "cloud" + JOB_TYPE_RESEND_INVITATION_EMAIL = "resend_invitation_email" JOB_STATUS_PENDING = "pending" JOB_STATUS_IN_PROGRESS = "in_progress" @@ -33,6 +38,25 @@ const ( JOB_STATUS_WARNING = "warning" ) +var ALL_JOB_TYPES = [...]string{ + JOB_TYPE_DATA_RETENTION, + JOB_TYPE_MESSAGE_EXPORT, + JOB_TYPE_ELASTICSEARCH_POST_INDEXING, + JOB_TYPE_ELASTICSEARCH_POST_AGGREGATION, + JOB_TYPE_BLEVE_POST_INDEXING, + JOB_TYPE_LDAP_SYNC, + JOB_TYPE_MIGRATIONS, + JOB_TYPE_PLUGINS, + JOB_TYPE_EXPIRY_NOTIFY, + JOB_TYPE_PRODUCT_NOTICES, + JOB_TYPE_ACTIVE_USERS, + JOB_TYPE_IMPORT_PROCESS, + JOB_TYPE_IMPORT_DELETE, + JOB_TYPE_EXPORT_PROCESS, + JOB_TYPE_EXPORT_DELETE, + JOB_TYPE_CLOUD, +} + type Job struct { Id string `json:"id"` Type string `json:"type"` @@ -66,7 +90,12 @@ func (j *Job) IsValid() *AppError { case JOB_TYPE_PRODUCT_NOTICES: case JOB_TYPE_EXPIRY_NOTIFY: case JOB_TYPE_ACTIVE_USERS: + case JOB_TYPE_IMPORT_PROCESS: + case JOB_TYPE_IMPORT_DELETE: + case JOB_TYPE_EXPORT_PROCESS: + case JOB_TYPE_EXPORT_DELETE: case JOB_TYPE_CLOUD: + case JOB_TYPE_RESEND_INVITATION_EMAIL: default: return NewAppError("Job.IsValid", "model.job.is_valid.type.app_error", nil, "id="+j.Id, http.StatusBadRequest) } @@ -94,9 +123,8 @@ func JobFromJson(data io.Reader) *Job { var job Job if err := json.NewDecoder(data).Decode(&job); err == nil { return &job - } else { - return nil } + return nil } func JobsToJson(jobs []*Job) string { @@ -108,9 +136,8 @@ func JobsFromJson(data io.Reader) []*Job { var jobs []*Job if err := json.NewDecoder(data).Decode(&jobs); err == nil { return jobs - } else { - return nil } + return nil } func (j *Job) DataToJson() string { -- cgit v1.2.3