我正在开发一个将在 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/