怎么样内存缓存.incr()受应用程序引擎维护期的影响?

2024-04-23 11:47:33 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在开发一个可以在googleappengine上运行的应用程序。我希望它能优雅地响应App引擎的维护周期。在

According to the documentation,memcache在维护期间不会存储或检索数据:

During a read-only maintenance period, calls to the memcache API will not throw exceptions but will instead return False for set() calls and None for get() calls (just like any other cache miss). In addition, memcache API calls will return immediately during this period, without any additional latency.

这也适用于incr()调用吗?看起来应该,但我找不到任何与此相关的文档,我想确定一下。在


Tags: theto引擎apiapp应用程序forreturn
1条回答
网友
1楼 · 发布于 2024-04-23 11:47:33

incr()states的文档:

The return value is a new long integer value, or None if key was not in the cache or could not be incremented for any other reason.

由于文档还明确指出,您无法在维护期间设置或获取数据,而且incr()实际上只是set()周围的一个辅助函数,因此在维护期间,incr()函数的返回值应该为None。在

相关问题 更多 >