force cache update
This commit is contained in:
parent
5bf53ba463
commit
4a3fecab19
1 changed files with 7 additions and 6 deletions
|
@ -48,7 +48,7 @@ def _get_file_cache():
|
||||||
path = path[3:]
|
path = path[3:]
|
||||||
return os.path.join(path, 'files.sqlite')
|
return os.path.join(path, 'files.sqlite')
|
||||||
|
|
||||||
def cache(filename, type='oshash'):
|
def cache(filename, type='oshash', update=False):
|
||||||
conn = sqlite3.connect(_get_file_cache(), timeout=10)
|
conn = sqlite3.connect(_get_file_cache(), timeout=10)
|
||||||
conn.row_factory = sqlite3.Row
|
conn.row_factory = sqlite3.Row
|
||||||
|
|
||||||
|
@ -68,6 +68,7 @@ def cache(filename, type='oshash'):
|
||||||
info = ''
|
info = ''
|
||||||
for row in c:
|
for row in c:
|
||||||
if stat.st_size == row['size'] and int(stat.st_mtime) == int(row['mtime']):
|
if stat.st_size == row['size'] and int(stat.st_mtime) == int(row['mtime']):
|
||||||
|
if not update:
|
||||||
value = row[type]
|
value = row[type]
|
||||||
if value:
|
if value:
|
||||||
if type == 'info':
|
if type == 'info':
|
||||||
|
|
Loading…
Reference in a new issue