web2py version: 2.9.12-stable
Postgres server: 9.1
I have 3 databases for my application, only one is designated for Scheduler
and its tables. What I noticed is that when I start scheduler (using
upstart deployment and running "start web2py-scheduler" as root), all 3
databases are immediately connected to. These connections become "idle in
transaction" (using ps aux | grep postgres) which sometimes causes locking
problems when I attempt make changes to the databases (either through the
app or executing a script). I'm assuming that Scheduler makes these kinds
of connections so we can use DAL when defining the task functions. However
the tasks I have set up for Scheduler calls a standalone script that does
not rely on web2py or DAL and uses pyscopg2 to access/modify the other 2
databases. Is there a way I can have Scheduler run without holding up the
other 2 databases?
Here's a snippet of my Scheduler set up:
from gluon.scheduler import Scheduler
scheduler_db = DAL(config.get('connection'), pool_size=10, migrate=False)
scheduler = Scheduler(
scheduler_db,
heartbeat = 5,
migrate = '',
tasks = dict(
taskA = taskA,
taskB = taskB
)
)
--
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.