mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-25 06:57:22 +00:00
Stats: Fix two swapped function names (#4376)
The function names `count_users_active_6m` and `count_users_active_1m` were swapped. As the names were swapped on both sides (declaration and use), this had no functional impact. No related isse was tracked.
This commit is contained in:
commit
5c0b6d8afa
@ -15,7 +15,7 @@ module Invidious::Database::Statistics
|
|||||||
PG_DB.query_one(request, as: Int64)
|
PG_DB.query_one(request, as: Int64)
|
||||||
end
|
end
|
||||||
|
|
||||||
def count_users_active_1m : Int64
|
def count_users_active_6m : Int64
|
||||||
request = <<-SQL
|
request = <<-SQL
|
||||||
SELECT count(*) FROM users
|
SELECT count(*) FROM users
|
||||||
WHERE CURRENT_TIMESTAMP - updated < '6 months'
|
WHERE CURRENT_TIMESTAMP - updated < '6 months'
|
||||||
@ -24,7 +24,7 @@ module Invidious::Database::Statistics
|
|||||||
PG_DB.query_one(request, as: Int64)
|
PG_DB.query_one(request, as: Int64)
|
||||||
end
|
end
|
||||||
|
|
||||||
def count_users_active_6m : Int64
|
def count_users_active_1m : Int64
|
||||||
request = <<-SQL
|
request = <<-SQL
|
||||||
SELECT count(*) FROM users
|
SELECT count(*) FROM users
|
||||||
WHERE CURRENT_TIMESTAMP - updated < '1 month'
|
WHERE CURRENT_TIMESTAMP - updated < '1 month'
|
||||||
|
@ -56,8 +56,8 @@ class Invidious::Jobs::StatisticsRefreshJob < Invidious::Jobs::BaseJob
|
|||||||
users = STATISTICS.dig("usage", "users").as(Hash(String, Int64))
|
users = STATISTICS.dig("usage", "users").as(Hash(String, Int64))
|
||||||
|
|
||||||
users["total"] = Invidious::Database::Statistics.count_users_total
|
users["total"] = Invidious::Database::Statistics.count_users_total
|
||||||
users["activeHalfyear"] = Invidious::Database::Statistics.count_users_active_1m
|
users["activeHalfyear"] = Invidious::Database::Statistics.count_users_active_6m
|
||||||
users["activeMonth"] = Invidious::Database::Statistics.count_users_active_6m
|
users["activeMonth"] = Invidious::Database::Statistics.count_users_active_1m
|
||||||
|
|
||||||
STATISTICS["metadata"] = {
|
STATISTICS["metadata"] = {
|
||||||
"updatedAt" => Time.utc.to_unix,
|
"updatedAt" => Time.utc.to_unix,
|
||||||
|
Loading…
Reference in New Issue
Block a user