A correction to the above, it should have been "== True" (or the loop
switched around).

On Aug 31, 8:50 pm, tijer <troels...@gmail.com> wrote:
> 12 hours from now everything will revert to read-only and memcache
> will fail. So, what to do? Well, x from Google provided a very useful
> option on how to detect that the server has gone into read-only mode:
>
> capabilities.CapabilitySet('datastore_v3', ['write']).is_enabled()
>
> This will return a boolean value, and should look something like the
> following in python:
>
> from google.appengine.api import capabilities # check capabilities
> with this import
>
> if capabilities.CapabilitySet('datastore_v3', ['write']).is_enabled()
> == False:
>   # render page normally here, including relying on writes and
> memcache
> else:
>   # fail gracefully here - possibly letting the user know that there's
> maintenance going on and that he/she should wait half an hour and
> check again
>
> HOWEVER, there is a huge problem. I just did something similar for my
> app, with the result that it immediately gave me massive quota-fails.
> As soon as 100 of the capabilities.CapabilitySet('datastore_v3',
> ['write']).is_enabled() had been used, it began returning over-quota
> errors in the logs.
>
> I can't find the quota-reference that I have presumably been
> surpassing anywhere in the documentation, but it suddenly showed up as
> "Capability Configs Requested" and "Capability Configs Recieved". This
> should really have been reflected in the email sent out, or at least
> in the quota documentation.
>
> Under normal circumstances I would cache the response by is_enabled()
> in memcache - but since this will not work either during maintenance -
> there's really nothing to use the above for unless your site will have
> less than 100 hits.
>
> I write this, so that others might not do the same.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to