(name string, message map[string]interface{})
| 53 | } |
| 54 | |
| 55 | func (i *notifyServer) SendNotify(name string, message map[string]interface{}) { |
| 56 | msg := make(map[string]string) |
| 57 | for k, v := range message { |
| 58 | bt, _ := json.Marshal(v) |
| 59 | msg[k] = string(bt) |
| 60 | } |
| 61 | response, err := MyService.MessageBus().PublishEventWithResponse(context.Background(), common.SERVICENAME, name, msg) |
| 62 | if err != nil { |
| 63 | logger.Error("failed to publish event to message bus", zap.Error(err), zap.Any("event", msg)) |
| 64 | return |
| 65 | } |
| 66 | if response.StatusCode() != http.StatusOK { |
| 67 | logger.Error("failed to publish event to message bus", zap.String("status", response.Status()), zap.Any("response", response)) |
| 68 | } |
| 69 | // SocketServer.BroadcastToRoom("/", "public", path, message) |
| 70 | } |
| 71 | |
| 72 | // Send periodic broadcast messages |
| 73 | func (i *notifyServer) SendFileOperateNotify(nowSend bool) { |
nothing calls this directly
no test coverage detected