[web2py] Re: Sharing function between controller and scheduler

2017-08-17 Thread Anthony
Yes, the worker processes are separate instances of the Python interpreter, so you must restart them for any changes in modules to take effect. Anthony On Thursday, August 17, 2017 at 1:51:44 PM UTC-4, David Orme wrote: > > I've still got some very odd differences between the controller and the

[web2py] Re: Sharing function between controller and scheduler

2017-08-17 Thread David Orme
I've still got some very odd differences between the controller and the scheduler. The task function uses an external module, stored in the application `modules` folder. I've updated it recently, and deleted the .pyc before doing so, so it should all be up to date. I've also restarted the apach

[web2py] Re: Sharing function between controller and scheduler

2017-08-17 Thread Anthony
Also, note that it shouldn't be a problem to call db.commit() within a controller action. The only downside is if the action subsequently throws an exception and a ticket is issued, the transaction that was committed will not be rolled back. Anthony On Thursday, August 17, 2017 at 9:20:06 AM U

[web2py] Re: Sharing function between controller and scheduler

2017-08-17 Thread Leonel Câmara
That seems fine to me. Note however that you can know if the function is being run by the scheduler looking at request.is_scheduler -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues