]> git.phdru.name Git - m_librarian.git/commitdiff
Fix(sqlite): Execute VACUUM outside transaction
authorOleg Broytman <phd@phdru.name>
Sun, 7 May 2017 19:19:55 +0000 (22:19 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 7 May 2017 19:19:55 +0000 (22:19 +0300)
m_librarian/glst.py

index cf581b1d14c1f0c6a1a70891fbb291b4f5f31971..5864d7f9687ab4a318b4d39ad20e1d72d7a1a7f3 100755 (executable)
@@ -50,13 +50,14 @@ def _import_glst():
     connection = sqlhub.processConnection
     if connection.dbName == 'postgres':
         connection.query("VACUUM %s" % Genre.sqlmeta.table)
-    elif connection.dbName == 'sqlite':
-        connection.query("VACUUM")
     return old_fb2 + old_nonfb2, new_fb2 + new_nonfb2
 
 
 def import_glst():
     return sqlhub.doInTransaction(_import_glst)
+    connection = sqlhub.processConnection
+    if connection.dbName == 'sqlite':
+        connection.query("VACUUM")
 
 
 def test():