Scheduler task (defined inside a module) won't run new code even after restarting uWSGI

19 views
Skip to first unread message

Lisandro

unread,
Oct 12, 2018, 11:04:40 AM10/12/18
to web2py-users
I'm facing a weird issue: I have a scheduler task that is defined inside a module. At the same time, that function calls another function that is defined in **another** module.
I had to make some changes to the last module, so I restarted uWSGI, but the task is still running with the old code :/

This is more or less what I have:

in models/scheduler.py
def mytask():
   
from general import do_something
    do_something
()


in modules/general.py
def do_something():
   
from particular import do_another_stuff
   
print "hi there I'm doing something"
    do_another_stuff
()
   
return True


in modules/particular.py
def do_another_stuff():
   
print "hi there I'm doing another stuff"


I've recently changed the code of modules/particular.py but they aren't reflected.
Notice that I also changed the code of modules/general.py and those changes **are** in deed reflected. 

I can't recall exactly now, but I remember having recently dealed with a similar issue: a scheduled task whose code is defined in a module that at the same time calls a function defined in another module. In this scenario, changes to the last module aren't reflected when the task is run from the scheduler environment. Does it make sense?

I've also tried deleting modules/*.pyc but it didn't work.
What am I missing?

Lisandro

unread,
Oct 12, 2018, 11:10:02 AM10/12/18
to web2py-users
Sorry, my bad.
I realised that I had to restart scheduler workers, not uWSGI workers.
So I restarted the scheduler workers and it worked.

Sorry for the bother!
Reply all
Reply to author
Forward
0 new messages