[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-05 Thread Yassen D.
Niphlod, yes, that was it !! It was not in the db.py but there was a 0.py with 'settings.migrate = True' (this is not my app, I was just asked to hack there to fix an issue). An easy workaround might be to also set fake_migrations to True (fake_migrate_all=True in DAL() creation) and copy and

Re: [web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-05 Thread Yassen Damyanov
Niphlod, HUGE THANKS! I'll check that right now and post back. On Thu, Dec 5, 2013 at 11:53 PM, Niphlod wrote: > check for > db = DAL(migrate_enabled=False) > > either this prevented the creation of the table, or some another > migrate-related glitch. > To create scheduler's tables, you just

[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-05 Thread Niphlod
check for db = DAL(migrate_enabled=False) either this prevented the creation of the table, or some another migrate-related glitch. To create scheduler's tables, you just need to do (as you did) Scheduler(db, ...) NB: (just a naming-convention advice) use from gluon.scheduler import Schedu

[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-04 Thread Yassen D.
On Thursday, December 5, 2013 9:33:15 AM UTC+2, Yassen D. wrote: > > ... I get an exception saying that table socialjack.scheduler_task does > not exist (traceback below). But the table IS there, I can see it in the db > admin interface and on the MySQL console ... > Not really, the table is s

[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-04 Thread Yassen D.
On Thursday, December 5, 2013 8:40:28 AM UTC+2, Yassen D. wrote: > > > > On Wednesday, December 4, 2013 10:28:43 PM UTC+2, Leonel Câmara wrote: >> >> Instead of rerunning the task with period, schedule new tasks every time >> you need to go get the user's friends >> > > I guess I have to create a

[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-04 Thread Yassen D.
On Wednesday, December 4, 2013 10:28:43 PM UTC+2, Leonel Câmara wrote: > > Instead of rerunning the task with period, schedule new tasks every time > you need to go get the user's friends > I guess I have to create a record into the scheduler_task table, with some reasonable values, and then

[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-04 Thread Yassen D.
Leonel, thanks so much for the advice! On Wednesday, December 4, 2013 10:28:43 PM UTC+2, Leonel Câmara wrote: > > Instead of rerunning the task with period, schedule new tasks every time > you need to go get the user's friends and have many scheduler workers if > there's a chance you will have

[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-04 Thread Leonel Câmara
Instead of rerunning the task with period, schedule new tasks every time you need to go get the user's friends and have many scheduler workers if there's a chance you will have to do many of these in parallel. You should be able to lower the interval as much as you need, you could even reduce t

[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-03 Thread Yassen D.
On Monday, December 2, 2013 6:20:54 PM UTC+2, Massimo Di Pierro wrote: > > The scheduler should do what you need. You can start many workers to > manage the load > >> >> Thanks, Massimo! I upgraded to 2.8.2 with minor issues (MySQL date fields seem to have been mapped to strings and now to datet

[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-02 Thread Massimo Di Pierro
The scheduler should do what you need. You can start many workers to manage the load. On Monday, 2 December 2013 05:51:26 UTC-6, Yassen D. wrote: > > Massimo, thanks a lot for your help! > > I will upgrade right away then. (I have very limited time, so I was afraid > to break things.) > > My com

[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-02 Thread Yassen D.
Massimo, thanks a lot for your help! I will upgrade right away then. (I have very limited time, so I was afraid to break things.) My comments: (a) We need to get the import process run instantly on user UI action (link click). Couple of seconds later is okay, but half a minute later is not ok

[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-01 Thread Massimo Di Pierro
The first recommendation would be upgrade to 2.8.2 (nothing should break) and use the scheduler. Do not use threads because they may still be killed by the web server. You can run a simple background process that every minute checks if there is something to do. Then use an auxiliary table to que