Fixed database locking in explore.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Mon, 22 Mar 2010 19:30:10 +0000 (19:30 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Mon, 22 Mar 2010 19:30:10 +0000 (19:30 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@439 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFETGlitch.py

index 49db85c..61dc65b 100644 (file)
@@ -249,7 +249,9 @@ class GoodFETGlitch(GoodFET):
             self.db.execute("insert into glitches(time,vcc,gnd,trials,glitchcount,count,lock)"
                    "values (%i,%i,%i,%i,%i,%i,%i);" % (
                 time,vcc,gnd,trials,gcount,scount,lock));
             self.db.execute("insert into glitches(time,vcc,gnd,trials,glitchcount,count,lock)"
                    "values (%i,%i,%i,%i,%i,%i,%i);" % (
                 time,vcc,gnd,trials,gcount,scount,lock));
-        else:
+        elif scount>0:
+            print "INSERTING AN EXPLOIT point, t=%i and vcc=%i" % (time,vcc);
             self.db.execute("insert into exploits(time,vcc,gnd,trials,count)"
                    "values (%i,%i,%i,%i,%i);" % (
                 time,vcc,gnd,trials,scount));
             self.db.execute("insert into exploits(time,vcc,gnd,trials,count)"
                    "values (%i,%i,%i,%i,%i);" % (
                 time,vcc,gnd,trials,scount));
+            self.db.commit(); #Don't leave a lock open.