github.com/adacta-ru/mattermost-server/v6@v6.0.0/app/plugin_event.go (about)

     1  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
     2  // See LICENSE.txt for license information.
     3  
     4  package app
     5  
     6  import (
     7  	"github.com/adacta-ru/mattermost-server/v6/model"
     8  )
     9  
    10  // notifyClusterPluginEvent publishes `event` to other clusters.
    11  func (a *App) notifyClusterPluginEvent(event string, data model.PluginEventData) {
    12  	if a.Cluster() != nil {
    13  		a.Cluster().SendClusterMessage(&model.ClusterMessage{
    14  			Event:            event,
    15  			SendType:         model.CLUSTER_SEND_RELIABLE,
    16  			WaitForAllToSend: true,
    17  			Data:             data.ToJson(),
    18  		})
    19  	}
    20  }