From f0cc7a925c3e936c30b5b4781ff27c9f03a34071 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Fri, 1 Mar 2019 19:55:07 -0600 Subject: [PATCH] Add 'lastChannelRefreshedAt' to /api/v1/stats --- src/invidious.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index 7222e264..70c62dbc 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -145,7 +145,8 @@ if config.statistics_enabled }, }, "metadata" => { - "updatedAt" => Time.now.to_unix, + "updatedAt" => Time.now.to_unix, + "lastChannelRefreshedAt" => PG_DB.query_one?("SELECT updated FROM channels ORDER BY updated DESC LIMIT 1", as: Time).try &.to_unix || 0, }, }