mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 21:03:21 -07:00
Fix some log table styling.
Refresh user list on start-up and schedule refresh every 12 hours. Handle malformed lines when reading Plex logs slightly more gracefully. Send back empty list instead of None on some plex.tv requests.
This commit is contained in:
parent
0810584b46
commit
b4f1bddc02
6 changed files with 63 additions and 30 deletions
|
@ -29,7 +29,7 @@ import uuid
|
|||
from apscheduler.schedulers.background import BackgroundScheduler
|
||||
from apscheduler.triggers.interval import IntervalTrigger
|
||||
|
||||
from plexpy import versioncheck, logger, monitor
|
||||
from plexpy import versioncheck, logger, monitor, plextv
|
||||
import plexpy.config
|
||||
|
||||
PROG_DIR = None
|
||||
|
@ -162,6 +162,10 @@ def initialize(config_file):
|
|||
else:
|
||||
LATEST_VERSION = CURRENT_VERSION
|
||||
|
||||
# Refresh the users list on startup
|
||||
if CONFIG.PMS_TOKEN:
|
||||
plextv.refresh_users()
|
||||
|
||||
# Store the original umask
|
||||
UMASK = os.umask(0)
|
||||
os.umask(UMASK)
|
||||
|
@ -249,16 +253,21 @@ def initialize_scheduler():
|
|||
# Check if scheduler should be started
|
||||
start_jobs = not len(SCHED.get_jobs())
|
||||
|
||||
#Update check
|
||||
# Update check
|
||||
if CONFIG.CHECK_GITHUB_INTERVAL:
|
||||
minutes = CONFIG.CHECK_GITHUB_INTERVAL
|
||||
else:
|
||||
minutes = 0
|
||||
schedule_job(versioncheck.checkGithub, 'Check GitHub for updates', hours=0, minutes=minutes)
|
||||
|
||||
# Start checking for new sessions every minute
|
||||
if CONFIG.PMS_IP:
|
||||
schedule_job(monitor.check_active_sessions, 'Check for active sessions', hours=0, minutes=0, seconds=60)
|
||||
|
||||
# Refresh the users list every 12 hours (we will make this configurable later)
|
||||
if CONFIG.PMS_TOKEN:
|
||||
schedule_job(plextv.refresh_users, 'Refresh users list', hours=12, minutes=0, seconds=0)
|
||||
|
||||
# Start scheduler
|
||||
if start_jobs and len(SCHED.get_jobs()):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue