From 70dc1a9f11eb3bd6faffe3b4aa7491185fb5ce20 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 31 Oct 2024 21:38:59 -0300 Subject: [PATCH] Tokens: Better logging --- src/invidious/helpers/redis_tokens.cr | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/invidious/helpers/redis_tokens.cr b/src/invidious/helpers/redis_tokens.cr index 7c0970e7..9650ecf9 100644 --- a/src/invidious/helpers/redis_tokens.cr +++ b/src/invidious/helpers/redis_tokens.cr @@ -6,9 +6,14 @@ module Tokens def refresh_tokens @@po_token = REDIS_DB.get("invidious:po_token") @@visitor_data = REDIS_DB.get("invidious:visitor_data") - LOGGER.debug("RefreshTokens: Tokens are:") - LOGGER.debug("RefreshTokens: po_token: #{@@po_token}") - LOGGER.debug("RefreshTokens: visitor_data: #{@@visitor_data}") + if !@@po_token.nil? && !@@visitor_data.nil? + LOGGER.debug("RefreshTokens: Successfully updated tokens") + else + LOGGER.warn("RefreshTokens: Tokens are empty!") + end + LOGGER.trace("RefreshTokens: Tokens are:") + LOGGER.trace("RefreshTokens: po_token: #{@@po_token}") + LOGGER.trace("RefreshTokens: visitor_data: #{@@visitor_data}") end def get_tokens