mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[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>
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/store"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -24,7 +24,7 @@ func init() {
|
||||
RootCmd.AddCommand(IntegrityCmd)
|
||||
}
|
||||
|
||||
func printRelationalIntegrityCheckResult(data store.RelationalIntegrityCheckData, verbose bool) {
|
||||
func printRelationalIntegrityCheckResult(data model.RelationalIntegrityCheckData, verbose bool) {
|
||||
fmt.Printf("Found %d records in relation %s orphans of relation %s\n",
|
||||
len(data.Records), data.ChildName, data.ParentName)
|
||||
if !verbose {
|
||||
@@ -57,9 +57,9 @@ func printRelationalIntegrityCheckResult(data store.RelationalIntegrityCheckData
|
||||
}
|
||||
}
|
||||
|
||||
func printIntegrityCheckResult(result store.IntegrityCheckResult, verbose bool) {
|
||||
func printIntegrityCheckResult(result model.IntegrityCheckResult, verbose bool) {
|
||||
switch data := result.Data.(type) {
|
||||
case store.RelationalIntegrityCheckData:
|
||||
case model.RelationalIntegrityCheckData:
|
||||
printRelationalIntegrityCheckResult(data, verbose)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user