From 4e6a931de39526dc90b1a3143b4cbec5751fa14d Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Thu, 11 Apr 2019 12:13:25 -0500 Subject: [PATCH] Make check_tables config option --- src/invidious.cr | 2 ++ src/invidious/helpers/helpers.cr | 1 + 2 files changed, 3 insertions(+) diff --git a/src/invidious.cr b/src/invidious.cr index 9a2bd260a..cb0950999 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -105,12 +105,14 @@ end Kemal::CLI.new ARGV +if CONFIG.check_tables # Check table integrity analyze_table(PG_DB, logger, "channel_videos", ChannelVideo) analyze_table(PG_DB, logger, "nonces", Nonce) analyze_table(PG_DB, logger, "session_ids", SessionId) analyze_table(PG_DB, logger, "users", User) analyze_table(PG_DB, logger, "videos", Video) +end # Start jobs refresh_channels(PG_DB, logger, config.channel_threads, config.full_refresh) diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index bf96842fc..d62e7ba6a 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -115,6 +115,7 @@ user: String, converter: ConfigPreferencesConverter, }, dmca_content: {type: Array(String), default: [] of String}, # For compliance with DMCA, disables download widget using list of video IDs + check_tables: {type: Bool, default: false}, # Check table integrity, automatically try to add any missing columns, create tables, etc. }) end