It is because pydal-db-connection is thread safe and as you switch to 
another thread there is no initialized pydal-db-connection in that thread
so you can try *db._adapter.reconnect() i*n your target function (this is 
that py4web does on every request)
And (as far as I understand) you cannot share uncommitted db-changes 
between threads as they each have their own db connection
суббота, 30 января 2021 г. в 08:58:50 UTC+3, snide...@gmail.com: 
> On Saturday, December 12, 2020 at 3:20:46 AM UTC-8 ermolaev...@gmail.com 
> wrote:
>
>> code:
>> threadGetRate = Thread(target=get_from_exch, args=(db, exchg))
>> threadGetRate.start()
>>
>> I start app by:
>>
>> > web2py.py -S 7pay_in -M -R applications/7pay_in/modules/serv_rates.py 
>> -A True 60
>>
>> rise error - for connection to DB
>>
>
>
> I'm not sure what you are trying to do here, and I don't what error you 
> are saying is happening.
>
> Can you provide more information?
>
> (typically, each request runs in its own thread, and how many threads 
> there are may depend on the front end (Rocket, NginX, Apache, unicorn, 
> etc);  The scheduler also managers a pool of threads).)
>
> /dps
>
>
>  
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/1d631b25-85ff-4c3f-961c-e41566431d4cn%40googlegroups.com.

Reply via email to