mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Do not rely on config.SERVER_MODE for determining (if it is running from
runtime, or time), instead check the environment variable PGADMIN_PORT to do that as per Dave.
This commit is contained in:
@@ -33,6 +33,13 @@ if sys.version_info < (3,):
|
|||||||
else:
|
else:
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
|
# The port number should have already been set by the runtime if we're running
|
||||||
|
# in desktop mode.
|
||||||
|
PGADMIN_RUNTIME = False
|
||||||
|
|
||||||
|
if 'PGADMIN_PORT' in globals():
|
||||||
|
PGADMIN_RUNTIME = True
|
||||||
|
|
||||||
|
|
||||||
def get_current_time(format='%Y-%m-%d %H:%M:%S.%f %z'):
|
def get_current_time(format='%Y-%m-%d %H:%M:%S.%f %z'):
|
||||||
"""
|
"""
|
||||||
@@ -181,7 +188,7 @@ class BatchProcess(object):
|
|||||||
|
|
||||||
p = None
|
p = None
|
||||||
cmd = [
|
cmd = [
|
||||||
(sys.executable if config.SERVER_MODE else
|
(sys.executable if not PGADMIN_RUNTIME else
|
||||||
'pythonw.exe' if os.name == 'nt' else 'python'),
|
'pythonw.exe' if os.name == 'nt' else 'python'),
|
||||||
executor,
|
executor,
|
||||||
'-p', self.id,
|
'-p', self.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user