summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/mattermost-server/v5/model/job.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-10-17 00:47:22 +0200
committerGitHub <noreply@github.com>2021-10-17 00:47:22 +0200
commit4dd8bae5c91fa4aef09d865d8fef1acd84f90925 (patch)
treeffad9b242daccaf8c86d1c1fbd59032302bd3be9 /vendor/github.com/mattermost/mattermost-server/v5/model/job.go
parent7ae45c42e712bd0e66c101f3f714c05aa1dc2104 (diff)
downloadmatterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.tar.gz
matterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.tar.bz2
matterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.zip
Update dependencies (#1610)
* Update dependencies * Update module to go 1.17
Diffstat (limited to 'vendor/github.com/mattermost/mattermost-server/v5/model/job.go')
-rw-r--r--vendor/github.com/mattermost/mattermost-server/v5/model/job.go35
1 files changed, 31 insertions, 4 deletions
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 {