Folks,
We have a long-running process that I've been trying to make into a
backend, thus far to no avail. So any help would be much appreciated.
app.yaml
======================
application: app-name
version: api-storage-transition
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /task/(.*)
script: tasks.app
login: admin
- url: /migration/ids.*
script: migration.app
libraries:
- name: webapp2
version: "2.5.1"
- name: pycrypto
version: "2.6"
inbound_services:
- mail
====
backends.yaml
===========
backends:
- name: migration
instances: 1
options: public
============
migration.py
===========
import webapp2
import logging
from google.appengine.api.backends import get_instance
class ModelMigrationHanlder(webapp2.RequestHandler):
"""One-time migration handler for Model.id -> Model.model_id"""
models = ['model1', 'model2', 'model3'']
def get(self):
if get_instance() is not None:
logging.info('Starting model schema migration')
for m in self.models:
logging.info('fetching model %s records' % m)
recs = self.fetch_records(m)
logging.info('Migrating %s records' % len(recs))
else:
logging.info('Not running as a backend')
....
I send a request to http://migration.<app_name>.appspot.com/migration/ids
and within ~30 seconds it 500's witha DeadlineExceededError. Also, in spite
of what the docs for backends.get_instance() say, it returns an instance ID
even if it's not a backend (it's supposed to return None).
Again, any pointers are much appreciated.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.