Commits

Waldemar Kornewald committed 924b4f0

extended remote_api connection code to have a few more retries

Comments (0)

Files changed (1)

                                                    self.remote_api_path)
         logging.info('Setting up remote_api for "%s" at %s' %
                      (self.remote_app_id, remote_url))
+        if not have_appserver:
+            print 'Connecting to remote_api handler'
         from google.appengine.ext.remote_api import remote_api_stub
         remote_api_stub.ConfigureRemoteApi(self.remote_app_id,
             self.remote_api_path, auth_func, secure=self.secure_remote_api,
             rpc_server_factory=rpc_server_factory)
-        try:
-            remote_api_stub.MaybeInvokeAuthentication()
-        except HTTPError, e:
-            time.sleep(3)
+        retry_delay = 1
+        while retry_delay <= 16:
+            try:
+                remote_api_stub.MaybeInvokeAuthentication()
+            except HTTPError, e:
+                if not have_appserver:
+                    print 'Retrying in %d seconds...' % retry_delay
+                time.sleep(retry_delay)
+                retry_delay *= 2
+            else:
+                break
+        else:
             try:
                 remote_api_stub.MaybeInvokeAuthentication()
             except HTTPError, e:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.