views:

37

answers:

1

I'm working on an application that will run on Google App Engine. I would like it to respond gracefully to App Engine maintenance periods.

According to the documentation, memcache will simply not store or retrieve data during maintenance periods:

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.

Does this apply to incr() calls as well? It seems like it should, but I cannot find any documentation to this effect and I want to be sure.

+2  A: 

The documentation for 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.

As the documentation also makes clear that you're unable to set or get data during maintenance, and incr() is really just a helper function around set(), you should expect a return value of None during maintenance periods for the incr() function.

Andrew