From f0d287588ace15dee3e4e9447ec54d9b4fef8491 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Sun, 11 Jun 2017 13:56:49 +0100 Subject: [PATCH] Couple of minor performance tweaks. Tests on my Windows VM show a consistent 30% startup time reduction. --- runtime/pgAdmin4.cpp | 8 +------- web/config.py | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/runtime/pgAdmin4.cpp b/runtime/pgAdmin4.cpp index 83dd736e0..64fd98822 100644 --- a/runtime/pgAdmin4.cpp +++ b/runtime/pgAdmin4.cpp @@ -285,10 +285,6 @@ int main(int argc, char * argv[]) server->start(); - // This is a hack. Wait a second and then check to see if the server thread - // is still running. If it's not, we probably had a startup error - delay(1000); - // Any errors? if (server->isFinished() || server->getError().length() > 0) { @@ -332,7 +328,7 @@ int main(int argc, char * argv[]) // Generate the app server URL - QString appServerUrl = QString("http://localhost:%1/?key=%2").arg(port).arg(key); + QString appServerUrl = QString("http://127.0.0.1:%1/?key=%2").arg(port).arg(key); // Now the server should be up, we'll attempt to connect and get a response. // We'll retry in a loop a few time before aborting if necessary. @@ -354,8 +350,6 @@ int main(int argc, char * argv[]) exit(1); } - - delay(1000); } // Create & show the main window diff --git a/web/config.py b/web/config.py index 4700ff061..c3f8285e2 100644 --- a/web/config.py +++ b/web/config.py @@ -156,7 +156,7 @@ DESKTOP_USER = 'pgadmin4@pgadmin.org' # NOTE: This is NOT recommended for production use, only for debugging # or testing. Production installations should be run as a WSGI application # behind Apache HTTPD. -DEFAULT_SERVER = 'localhost' +DEFAULT_SERVER = '127.0.0.1' # The default port on which the app server will listen if not set in the # environment by the runtime