[pgAdmin4][Patch]: Stop Flask from initialising service twice in Debug mode

From: Surinder Kumar <surinder(dot)kumar(at)enterprisedb(dot)com>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: [pgAdmin4][Patch]: Stop Flask from initialising service twice in Debug mode
Date: 2017-07-21 07:02:39
Message-ID: CAM5-9D-1BTYsZC2VFcuDhdNeSZd+bLTWaCfTYs0eL6hiqTmS2g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

When pgAdmin4 runs in DEBUG mode, Flask initialise service twice, while in
non-DEBUG mode, once. It is pain while development because `yarn run
bundle` also runs twice.

It is because the parameter `use_reloader` = True in Debug Mode.

If `os.environ` variable `WERKZEUG_RUN_MAIN` is set to None, i.e. app is
starting for the first time and then its value is changed to True.

Please find attached patch.

Thanks
Surinder

Attachment Content-Type Size
start_flask_service_once_in_debug_mode.patch application/octet-stream 826 bytes

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Surinder Kumar 2017-07-21 07:27:21 Re: [pgAdmin4][Patch]: Stop Flask from initialising service twice in Debug mode
Previous Message Pawel Hadam 2017-07-21 06:14:05 Re: pgAdmin 4 v1.6 Released!