获取响应行错误 – Redigo Redis 客户端

huangapple go评论101阅读模式
英文:

Getting response line error - Redigo Redis Client

问题

我正在将JSON序列化的结构体转换为字符串,并在Redis连接上运行PUBLISH命令。

_, err := r.Do("PUBLISH", key, ncs)

这个Go服务用于处理/重新利用在我们的聊天应用程序上发送的所有消息,然后将事件发布到客户端。

偶尔,在执行PUBLISH命令后,Redis连接会出现以下错误之一:

  • redigo: bad response line terminator
  • redigo: unexpected response line

我无法理解这些错误,并且错误一直出现,这些响应的含义是什么?为什么会发生这种情况?

英文:

I'm creating strings out of JSON serialized structs and running a PUBLISH command on a redis connection this this.

_, err := r.Do("PUBLISH", key, ncs)

This go service is used in to process/repurpose all of the messages that get sent on our chat application, and then pub sub the events back to the clients.

Every so often the redis connection spits an error after the doing a PUBLISH command and it's one of the following:

  • redigo: bad response line terminator
  • redigo: unexpected response line

Have not been able to make sense of these and the error keeps showing up, what do these responses mean? && why might they be occurring for me?

答案1

得分: 6

应用程序正在同时访问连接。允许的并发性在文档中有所讨论(http://godoc.org/github.com/garyburd/redigo/redis#hdr-Concurrency)。考虑使用池(http://godoc.org/github.com/garyburd/redigo/redis#Pool)。

英文:

The application is accessing the connection concurrently. The allowed concurrency is discussed in the documentation. Consider using a pool.

huangapple
  • 本文由 发表于 2014年10月14日 00:36:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/26344782.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定