Revision 2796
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
333 | 333 |
|
334 | 334 |
return cur |
335 | 335 |
|
336 |
def is_cached(self, query, params=None):
|
|
337 |
return _query_lookup(query, params) in self.query_results
|
|
336 |
def is_cached(self, query): |
|
337 |
return _query_lookup(query, []) in self.query_results
|
|
338 | 338 |
|
339 | 339 |
def with_autocommit(self, func, autocommit=True): |
340 | 340 |
prev_autocommit = self.db.autocommit |
... | ... | |
406 | 406 |
try: |
407 | 407 |
def run(): return db.run_query(query, cacheable, log_level, |
408 | 408 |
debug_msg_ref, **kw_args) |
409 |
if recover and not db.is_cached(query, []):
|
|
409 |
if recover and not db.is_cached(query): |
|
410 | 410 |
return with_savepoint(db, run) |
411 | 411 |
else: return run() # don't need savepoint if cached |
412 | 412 |
except Exception, e: |
Also available in: Unified diff
sql.py: DbConn.is_cached(): Removed no longer used params parameter