[web2py] Re: DAL issues on production server (xen VM)

2013-12-16 Thread Yassen D.
Issue resolved. The source of all trouble was that the Scheduler uses the same db connection as the task it executes. Thus output updates (print '!clear!%(progress)s' % progress) changes the connection status, randomly, hence the strange exceptions. Suggestion: explicitly mention this as a

[web2py] Re: web2py ala static-site-generator

2013-12-16 Thread Yassen D.
How about generating most of the pages and serving them as static content (e.g. templates that have nothing to render, just plain HTML); then having some templates that really have stuff that needs to be rendered and processed (e.g. a contact form + a POST handler) ? -- Resources: -

[web2py] DAL issues on production server (xen VM)

2013-12-15 Thread Yassen D.
Hello guys, Recently updated from w2p 2.2.1 to 2.8.2 as I was advised; now random errors on database inserts started to raise for stuff that worked on the old version (2.2.1). Tracebacks of the two errors: This is the most common one: File /home/www-data/web2py/gluon/scheduler.py, line 238,

[web2py] Re: DAL issues on production server (xen VM)

2013-12-15 Thread Yassen D.
On Monday, December 16, 2013 2:46:00 AM UTC+2, Massimo Di Pierro wrote: Do you user virtual fields? Are you doing migrations while the scheduler tasks are running. This is strange because it is a very fundamental piece of web2py code that has not changed in long time: Massimo, thanks

[web2py] Scheduler-related database tables created on sqLite but NOT on MySQL

2013-12-05 Thread Yassen D.
Hello all, I follow a simple video-tutorial (http://vimeo.com/27478796); so I create a model scheduler.py with this content: def f(): t = time.ctime() open('/tmp/tasks', 'w').write(t + '\n') return f from gluon.scheduler import Scheduler Scheduler(db, dict(our_func=f)) After

[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

[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 to

[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 the

[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 record

[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 shown

[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 datetime

[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

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

2013-12-01 Thread Yassen D.
Hello guys, I am trying to help with a web2py application (web2py v. 2.2.1, ancient, yes) that needs an urgent patch as follows: There is a controller function that fetches all facebook friends of the user and stores them in the db (mysql). Currently this is done plainly in that function,