On Monday, June 4, 2018 at 1:18:45 PM UTC-7, Bryan Chance wrote:
>
> I believe I might be able to queue the task with application set to the 
> context I want it ran in, and then in db.py set request.vars.client to 
> request.application
>

I only set default application in my routes.py, so my results may not match 
yours, but inside your scheduler handler code (the model file), doesn't 
request.application show the right value?

/dps
 

>
> On Monday, June 4, 2018 at 1:55:42 PM UTC-5, Bryan Chance wrote:
>>
>> So I'm working to consolidate severall web2py apps that share ~85% of 
>> their code. They each have their own configurations, databases, etc.
>>
>> I accomplish this by using routes.py to map myurl.com/client_name to 
>> myurl.com/consolidated_app?client_name=client_name
>>
>> Then request.vars.client_name allows me to load client-specific db uris, 
>> models_to_run, etc. Now I need a way to do a similar thing with the 
>> scheduler. Since the request doesn't go the way http requests do, I can't 
>> load the "environment" to look the way for task for CllientA the way it 
>> would look for browsing myurl.com/ClientA.
>>
>> The only other way I can think to solve this would be to pass all needed 
>> data to queue_task and then create new db connections there. But then I run 
>> into the issue of the models won't be loaded as expected.
>>
>> Does anyone have any ideas?
>>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to