mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
(ids) re-create database if table count doesn't match
This commit is contained in:
parent
642cbe1cce
commit
2d9e600411
@ -140,9 +140,11 @@ class RuleCache(object):
|
||||
try:
|
||||
db = sqlite3.connect(self.cachefile)
|
||||
cur = db.cursor()
|
||||
cur.execute("select count(*) from sqlite_master WHERE type='table'")
|
||||
table_count = cur.fetchall()[0][0]
|
||||
cur.execute('SELECT max(timestamp), max(files) FROM stats')
|
||||
results = cur.fetchall()
|
||||
if last_mtime == results[0][0] and len(all_rule_files) == results[0][1]:
|
||||
if last_mtime == results[0][0] and len(all_rule_files) == results[0][1] and table_count == 3:
|
||||
return False
|
||||
except sqlite3.DatabaseError:
|
||||
# if some reason the cache is unreadble, continue and report changed
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user