[MM-25652] Add /integrity endpoint to local mode API (#15033)

* Fix direct/group channel false positives

* Move public structures to model package

* Expose CheckIntegrity as a local API method

* Remove extra file

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Claudio Costa
2020-07-27 10:20:22 +02:00
коммит произвёл GitHub
родитель c0fa478cdd
Коммит e5edf2683d
10 изменённых файлов: 367 добавлений и 212 удалений

Просмотреть файл

@@ -67,7 +67,7 @@ type Store interface {
TotalMasterDbConnections() int
TotalReadDbConnections() int
TotalSearchDbConnections() int
CheckIntegrity() <-chan IntegrityCheckResult
CheckIntegrity() <-chan model.IntegrityCheckResult
SetContext(context context.Context)
Context() context.Context
}
@@ -776,24 +776,6 @@ type UserGetByIdsOpts struct {
Since int64
}
type OrphanedRecord struct {
ParentId *string
ChildId *string
}
type RelationalIntegrityCheckData struct {
ParentName string
ChildName string
ParentIdAttr string
ChildIdAttr string
Records []OrphanedRecord
}
type IntegrityCheckResult struct {
Data interface{}
Err error
}
const mySQLDeadlockCode = uint16(1213)
// WithDeadlockRetry retries a given f if it throws a deadlock error.