[llvm-commits] [LNT] r154562 - /lnt/trunk/lnt/server/db/v4db.py

Daniel Dunbar daniel at zuster.org
Wed Apr 11 16:15:31 PDT 2012


Author: ddunbar
Date: Wed Apr 11 18:15:31 2012
New Revision: 154562

URL: http://llvm.org/viewvc/llvm-project?rev=154562&view=rev
Log:
lnt.server.db.v4db: Only attempt auto-update once per DB.

Modified:
    lnt/trunk/lnt/server/db/v4db.py

Modified: lnt/trunk/lnt/server/db/v4db.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/v4db.py?rev=154562&r1=154561&r2=154562&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/v4db.py (original)
+++ lnt/trunk/lnt/server/db/v4db.py Wed Apr 11 18:15:31 2012
@@ -12,6 +12,8 @@
     Wrapper object for LNT v0.4+ databases.
     """
 
+    _db_updated = set()
+
     class TestSuiteAccessor(object):
         def __init__(self, v4db):
             self.v4db = v4db
@@ -67,8 +69,11 @@
         self.path = path
         self.engine = sqlalchemy.create_engine(path, echo=echo)
 
-        # Update the database to the current version, if necessary.
-        lnt.server.db.migrate.update(self.engine)
+        # Update the database to the current version, if necessary. Only check
+        # this once per path.
+        if path not in V4DB._db_updated:
+            lnt.server.db.migrate.update(self.engine)
+            V4DB._db_updated.add(path)
 
         # Proxy object for implementing dict-like .testsuite property.
         self._testsuite_proxy = None





More information about the llvm-commits mailing list