Log instance IDs in internal channel callbacks.

This commit is contained in:
Ian Gulliver
2014-06-21 00:15:01 -07:00
parent 368c704b81
commit 88c49d6371

View File

@@ -29,6 +29,7 @@ class OnChannelConnect(webapp2.RequestHandler):
@db.transactional()
def post(self):
instance_id = self.request.get('from')
logging.info('Instance: %s', instance_id)
instance = models.Instance.FromID(instance_id)
if not instance:
logging.warning('Channel opened with invalid instance_id: %s', instance_id)
@@ -46,6 +47,7 @@ class OnChannelDisconnect(webapp2.RequestHandler):
@utils.local_namespace
def post(self):
instance_id = self.request.get('from')
logging.info('Instance: %s', instance_id)
instance_key = db.Key.from_path('Instance', instance_id)
subscriptions = list(models.Subscription.all().filter('instance =', instance_key))