Rename flush-cache.py to flush-cache, and rearrange the code a bit.

It was working fine, but the style wasn't exactly the way I like it, because
I'm unnecessarily picky. :)

Also, removed the file extension since we should probably learn from the
fact that it's already been rewritten once from one language to another.
Who knows, maybe it will be again someday.
This commit is contained in:
Avery Pennarun 2011-02-23 01:24:48 -08:00
commit 94c254de77
12 changed files with 47 additions and 51 deletions

16
t/flush-cache Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env python
import sys, os, sqlite3
if "DO_BUILT" in os.environ:
sys.exit(0)
sys.stderr.write("Flushing redo cache...\n")
db_file = os.path.join(os.environ["REDO_BASE"], ".redo/db.sqlite3")
db = sqlite3.connect(db_file, timeout=5000)
db.executescript("pragma synchronous = off;"
"update Files set checked_runid=checked_runid-1, "
" changed_runid=changed_runid-1, "
" failed_runid=failed_runid-1;")
db.commit()