Skip to content

Commit 94bb22d

Browse files
committed
Automagic: Make cache period longer and configurable
1 parent 1282257 commit 94bb22d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

volatility3/framework/automagic/symbol_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ class SqliteCache(CacheManagerInterface):
157157
_required_framework_version = (2, 0, 0)
158158
_version = (1, 0, 0)
159159

160-
cache_period = '-3 days'
161160

162161
def __init__(self, filename: str):
163162
super().__init__(filename)
163+
self.cache_period = constants.SQLITE_CACHE_PERIOD
164164
try:
165165
self._database = self._connect_storage(filename)
166166
except sqlite3.DatabaseError:

volatility3/framework/constants/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
CACHE_PATH = os.path.join(os.path.expanduser("~"), ".cache", "volatility3")
6464
"""Default path to store cached data"""
6565

66+
SQLITE_CACHE_PERIOD = '-1 month'
67+
"""SQLite time modifier for how long each item is valid in the cache for"""
68+
6669
if sys.platform == 'win32':
6770
CACHE_PATH = os.path.realpath(os.path.join(os.environ.get("APPDATA", os.path.expanduser("~")), "volatility3"))
6871
os.makedirs(CACHE_PATH, exist_ok = True)

0 commit comments

Comments
 (0)