【发布时间】:2013-11-14 23:24:46
【问题描述】:
我有一个应用程序尝试在 memcache 中存储小图像(小于 50kB),但每次调用 memcache.Set() 都会导致错误 memcache: server error。
我在共享内存缓存类上,所以我知道没有服务保证,但目前我根本没有服务。
是临时停电吗?我是不是运气不好?
这是创建项目并调用 memcache 的一段代码。 ctx 是请求的 appengine 上下文。 memkey 是我的密钥(一个字符串)。 img_data 是我的数据的字符串。
此代码在本地开发环境中运行良好。
cache_item = &memcache.Item{
Key: memkey,
Value: bytes.NewBufferString(img_data).Bytes(),
}
err = memcache.Set(ctx, cache_item)
if err != nil {
ctx.Infof("Could not store image in memcache: %s", err)
}
【问题讨论】:
-
你能展示你的代码吗?
标签: google-app-engine go memcached