Skip to content

Commit

Permalink
[GH-902]:Added check to uninstall server if not found in KV store (#914)
Browse files Browse the repository at this point in the history
* [MI-2738]:Added check to uninstall server if not found in KV store (#34)

* [MI-2738]:Added check to uninstall server if not found in KV store

* [MI-2738]:Fixed lint errors

* [MM-902]:Fixed review comment

* [MI-2781]:Fixed review comments for issue #902 and PR #914 on jira plugin (#36)

* [MM-902]:Reverted the changes

* [MM-902]:Reverted the disconnect users function
  • Loading branch information
Kshitij-Katiyar committed Jan 18, 2024
1 parent 0d6f72d commit ceac791
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package main

import (
"net/http"
"strings"

"github.com/mattermost/mattermost-server/v6/model"
"github.com/pkg/errors"
Expand Down Expand Up @@ -187,6 +188,15 @@ func (p *Plugin) UninstallInstance(instanceID types.ID, instanceType InstanceTyp
var err error
instance, err = p.instanceStore.LoadInstance(instanceID)
if err != nil {
if strings.Contains(err.Error(), "not found") {
instances.Delete(instanceID)
if err = p.instanceStore.StoreInstances(instances); err != nil {
return err
} else {
return nil
}
}

return err
}
if instanceType != instance.Common().Type {
Expand Down

0 comments on commit ceac791

Please sign in to comment.