[MM-19914] Fix data races in WebSocketEvent (#13039)

* Make WebSocketEvent type immutable

* Update code to use updated immutable WebSocketEvent type

* Export WebSocketEvent fields and mark them as deprecated
Этот коммит содержится в:
Claudio Costa
2019-12-24 09:32:11 +01:00
коммит произвёл GitHub
родитель 9ab7bee0a6
Коммит 80dd2915db
16 изменённых файлов: 216 добавлений и 94 удалений

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

@@ -315,7 +315,7 @@ func TestNotifyClusterPluginEvent(t *testing.T) {
for {
select {
case resp := <-webSocketClient.EventChannel:
if resp.Event == model.WEBSOCKET_EVENT_PLUGIN_STATUSES_CHANGED && len(resp.Data["plugin_statuses"].([]interface{})) == 0 {
if resp.EventType() == model.WEBSOCKET_EVENT_PLUGIN_STATUSES_CHANGED && len(resp.GetData()["plugin_statuses"].([]interface{})) == 0 {
done <- true
return
}