Add per thread SQLObject DBConnection
make associated tests pass SQLObject multi-thread access ***END OF DESCRIPTION*** Place the long patch description above the ***END OF DESCRIPTION*** marker. The first line of this file will be the patch name. This patch contains the following changes: M ./run_tests.py -1 +6 M ./src/jcl/jabber/component.py -30 +70 M ./src/jcl/jabber/feeder.py -5 +11 M ./src/jcl/model/account.py +6 M ./tests/jcl/jabber/test_component.py -19 +62 M ./tests/jcl/jabber/test_feeder.py -7 +45 darcs-hash:20061009172608-86b55-804b8910c5ff19414a4f016289d3f03fb73866f9.gz
This commit is contained in:
@@ -40,12 +40,14 @@ class FeederComponent(JCLComponent):
|
||||
jid,
|
||||
secret,
|
||||
server,
|
||||
port):
|
||||
port,
|
||||
db_connection_str):
|
||||
JCLComponent.__init__(self, \
|
||||
jid, \
|
||||
secret, \
|
||||
server, \
|
||||
port)
|
||||
port, \
|
||||
db_connection_str)
|
||||
self.name = "Generic Feeder Component"
|
||||
# Define default feeder and sender, can be override
|
||||
self.feeder = Feeder()
|
||||
@@ -56,9 +58,13 @@ class FeederComponent(JCLComponent):
|
||||
|
||||
def handle_tick(self):
|
||||
"""Implement main feed/send behavior"""
|
||||
for account in Account.select():
|
||||
for data in self.feeder.feed(account):
|
||||
self.sender.send(account, data)
|
||||
pass
|
||||
self.db_connect()
|
||||
for acc in self.account_class.select():
|
||||
print "OK"
|
||||
# for data in self.feeder.feed(account):
|
||||
# self.sender.send(account, data)
|
||||
self.db_disconnect()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user