Re: prevent AppConfig.ready() from running twice

2018-06-25 Thread clavierplayer
Thanks so much, y'all! Very helpful! On Sunday, June 24, 2018 at 3:47:48 AM UTC-4, Mike Dewhirst wrote: > > On 23/06/2018 6:17 PM, Melvyn Sopacua wrote: > > On zaterdag 23 juni 2018 02:01:06 CEST Mike Dewhirst wrote: > > > >> Is there a python singleton pattern which might work? > > No, cause

Re: prevent AppConfig.ready() from running twice

2018-06-24 Thread Mike Dewhirst
On 23/06/2018 6:17 PM, Melvyn Sopacua wrote: On zaterdag 23 juni 2018 02:01:06 CEST Mike Dewhirst wrote: Is there a python singleton pattern which might work? No, cause the startup is done in 2 different processes which do not share state. So both processes will have a "new singleton". This is

Re: prevent AppConfig.ready() from running twice

2018-06-23 Thread Melvyn Sopacua
On zaterdag 23 juni 2018 02:01:06 CEST Mike Dewhirst wrote: > Is there a python singleton pattern which might work? No, cause the startup is done in 2 different processes which do not share state. So both processes will have a "new singleton". This is why you need an IPC mechanism, such as file

Re: prevent AppConfig.ready() from running twice

2018-06-23 Thread Mike Dewhirst
, June 23, 2018 2:01:06 AM *To:* django-users@googlegroups.com *Subject:* Re: prevent AppConfig.ready() from running twice Is there a python singleton pattern which might work? /Connected by Motorola/ Melvyn Sopacua wrote: On donderdag 21 juni 2018 16:23:23 CEST clavierpla...@gmail.com wrote: >

Re: prevent AppConfig.ready() from running twice

2018-06-23 Thread PASCUAL Eric
cess) from outside the module. Hope this helps. Regards Eric From: django-users@googlegroups.com on behalf of Mike Dewhirst Sent: Saturday, June 23, 2018 2:01:06 AM To: django-users@googlegroups.com Subject: Re: prevent AppConfig.ready() from running twic

Re: prevent AppConfig.ready() from running twice

2018-06-22 Thread Mike Dewhirst
Is there a python singleton pattern which might work? Connected by Motorola Melvyn Sopacua wrote: >On donderdag 21 juni 2018 16:23:23 CEST clavierpla...@gmail.com wrote: > >> If it helps, here is the reason I need to override this multi-instantiation >> behavior: my application launches a multi

Re: prevent AppConfig.ready() from running twice

2018-06-22 Thread Melvyn Sopacua
On donderdag 21 juni 2018 16:23:23 CEST clavierpla...@gmail.com wrote: > If it helps, here is the reason I need to override this multi-instantiation > behavior: my application launches a multiprocessing.Process at startup to > monitor and run background tasks. Having more than one background Proce

prevent AppConfig.ready() from running twice

2018-06-21 Thread clavierplayer
Hello, I am still new to Django, so I apologize if this seems like a silly question. I've not been able to find what I need on Google, StackOverflow, or the Django Docs. I am using Django 2.0.5. I understand that the correct way to run startup code is to subclass AppConfig and override ready(