def _update_manifest(id, check_hash, failed_fetches): webapp = Webapp.objects.get(pk=id) version = webapp.versions.latest() file_ = version.files.latest() _log(webapp, u'Fetching webapp manifest') if not file_: _log(webapp, u'Ignoring, no existing file') return # Fetch manifest, catching and logging any exception. try: content = _fetch_manifest(webapp.manifest_url) except Exception, e: msg = u'Failed to get manifest from %s. Error: %s' % ( webapp.manifest_url, e) failed_fetches[id] = failed_fetches.get(id, 0) + 1 if failed_fetches[id] == 3: # This is our 3rd attempt, let's send the developer(s) an email to # notify him of the failures. notify_developers_of_failure(webapp, u'Validation errors:\n' + msg) elif failed_fetches[id] >= 4: # This is our 4th attempt, we should already have notified the # developer(s). Let's put the app in the re-review queue. _log(webapp, msg, rereview=True, exc_info=True) if webapp.status in amo.WEBAPPS_APPROVED_STATUSES: RereviewQueue.flag(webapp, amo.LOG.REREVIEW_MANIFEST_CHANGE, msg) del failed_fetches[id] else: _log(webapp, msg, rereview=False, exc_info=True) return
def _update_manifest(id, check_hash, failed_fetches): webapp = Webapp.objects.get(pk=id) version = webapp.versions.latest() file_ = version.files.latest() _log(webapp, u'Fetching webapp manifest') if not file_: _log(webapp, u'Ignoring, no existing file') return # Fetch manifest, catching and logging any exception. try: content = _fetch_manifest(webapp.manifest_url) except Exception, e: msg = u'Failed to get manifest from %s. Error: %s' % ( webapp.manifest_url, e) failed_fetches[id] = failed_fetches.get(id, 0) + 1 if failed_fetches[id] >= 3: _log(webapp, msg, rereview=True, exc_info=True) if webapp.status in amo.WEBAPPS_APPROVED_STATUSES: RereviewQueue.flag(webapp, amo.LOG.REREVIEW_MANIFEST_CHANGE, msg) del failed_fetches[id] else: _log(webapp, msg, rereview=False, exc_info=True) return
def _update_manifest(id): webapp = Webapp.objects.get(pk=id) file_ = webapp.get_latest_file() _log(webapp, u'Fetching webapp manifest') if not file_: _log(webapp, u'Ignoring, no existing file') return # Fetch manifest, catching and logging any exception. try: content = _fetch_manifest(webapp.manifest_url) except Exception, e: msg = u'Failed to get manifest from %s. Error: %s' % ( webapp.manifest_url, e.message) _log(webapp, msg, rereview=True, exc_info=True) RereviewQueue.flag(webapp, amo.LOG.REREVIEW_MANIFEST_CHANGE, msg) return
def _update_manifest(id, check_hash, failed_fetches): webapp = Webapp.objects.get(pk=id) file_ = webapp.get_latest_file() _log(webapp, u"Fetching webapp manifest") if not file_: _log(webapp, u"Ignoring, no existing file") return # Fetch manifest, catching and logging any exception. try: content = _fetch_manifest(webapp.manifest_url) except Exception, e: msg = u"Failed to get manifest from %s. Error: %s" % (webapp.manifest_url, e.message) _log(webapp, msg, rereview=True, exc_info=True) failed_fetches[id] = failed_fetches.get(id, 0) + 1 if failed_fetches[id] >= 3: _log(webapp, msg, rereview=True, exc_info=True) RereviewQueue.flag(webapp, amo.LOG.REREVIEW_MANIFEST_CHANGE, msg) del failed_fetches[id] else: _log(webapp, msg, rereview=False, exc_info=True) return