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

From: Matthew Kleiman <mkleiman(at)pivotal(dot)io>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Surinder Kumar <surinder(dot)kumar(at)enterprisedb(dot)com>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4][Patch]: Stop Flask from initialising service twice in Debug mode
Date: 2017-07-21 18:08:53
Message-ID: CAFS4TJZ+aQdfdyQ9fEmVY8x5Ne2Th0x8iJ8XMA8JSib+P1G-PA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Surinder, you are my hero! 🎁

On Fri, Jul 21, 2017 at 4:47 AM, Dave Page <dpage(at)pgadmin(dot)org> wrote:

> Thanks, applied. The reloader has always been a little temperamental for
> me, so I couldn't prove this doesn't break it. If someone finds it does,
> please yelp.
>
> On Fri, Jul 21, 2017 at 8:27 AM, Surinder Kumar <
> surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
>
>> Hi
>>
>> In this patch, i have added reference to the implementation.
>> Please find updated patch and review.
>>
>> Thanks,
>> Surinder
>>
>> On Fri, Jul 21, 2017 at 12:32 PM, Surinder Kumar <
>> surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
>>
>>> 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
>>>
>>>
>>>
>>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Shirley Wang 2017-07-21 18:26:31 Re: [pgAdmin4][Patch] Font sizes to 13 px and not bolded
Previous Message pgAdmin 4 Jenkins 2017-07-21 16:11:46 Jenkins build is back to normal : pgadmin4-master-python26 #381