python - memcache.incr() 受到 App Engine 维护期的影响吗?

标签 python google-app-engine memcached maintenance-mode

我正在开发一个将在 Google App Engine 上运行的应用程序。我希望它能够优雅地响应 App Engine 维护期。

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() 调用吗?看起来应该是这样,但我找不到任何这方面的文档,我想确定一下。

最佳答案

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 值。

关于python - memcache.incr() 受到 App Engine 维护期的影响吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3506503/

相关文章:

python - 如何在python中合并数据

python - 为什么 Google Compute Engine 中的多处理不使用 100% CPU?

python - 从 blobstore 发送数据作为 GAE 中的电子邮件附件

google-app-engine - App Engine 将应用程序拆分为模块

java - Java Google App Engine 中的角色

python - numpy数组的索引和?

python - 创建一个小部件嵌入到 QMainWindow 中

php - Laravel 5.1 查询包含数百万条记录的数据库

c# - 使用静态 MemcachedClient 的问题

java - GAE JCache NumberFormatException,我需要编写 Java 来避免吗?