mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-20 13:23:24 -07:00
Clear session metadata cache on startup
This commit is contained in:
parent
3e723d4373
commit
56dc28eed3
3 changed files with 14 additions and 3 deletions
|
@ -15,6 +15,7 @@
|
|||
|
||||
import os
|
||||
from Queue import Queue
|
||||
import shutil
|
||||
import sqlite3
|
||||
import sys
|
||||
import subprocess
|
||||
|
@ -156,6 +157,16 @@ def initialize(config_file):
|
|||
except OSError as e:
|
||||
logger.error(u"Could not create cache dir '%s': %s" % (CONFIG.CACHE_DIR, e))
|
||||
|
||||
if CONFIG.CACHE_DIR:
|
||||
session_metadata_folder = os.path.join(CONFIG.CACHE_DIR, 'session_metadata')
|
||||
try:
|
||||
shutil.rmtree(session_metadata_folder, ignore_errors=True)
|
||||
except OSError as e:
|
||||
pass
|
||||
|
||||
if not os.path.exists(session_metadata_folder):
|
||||
os.mkdir(session_metadata_folder)
|
||||
|
||||
# Initialize the database
|
||||
logger.info(u"Checking if the database upgrades are required...")
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue