From 790bbfcc990fc11174d2c0208bac2b6fbf79aac6 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Tue, 28 Jan 2020 13:29:36 -0500 Subject: [PATCH] integrate ar trending algorithm into configurable trending system --- lbry/wallet/server/db/trending/__init__.py | 2 ++ lbry/wallet/server/db/{trending_ar.py => trending/ar.py} | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) rename lbry/wallet/server/db/{trending_ar.py => trending/ar.py} (98%) diff --git a/lbry/wallet/server/db/trending/__init__.py b/lbry/wallet/server/db/trending/__init__.py index c9d9b616d..cfa8ab38b 100644 --- a/lbry/wallet/server/db/trending/__init__.py +++ b/lbry/wallet/server/db/trending/__init__.py @@ -1,6 +1,8 @@ from . import zscore +from . import ar TRENDING_ALGORITHMS = { 'zscore': zscore, + 'ar': ar } diff --git a/lbry/wallet/server/db/trending_ar.py b/lbry/wallet/server/db/trending/ar.py similarity index 98% rename from lbry/wallet/server/db/trending_ar.py rename to lbry/wallet/server/db/trending/ar.py index ae89e3953..3aaa6cdb5 100644 --- a/lbry/wallet/server/db/trending_ar.py +++ b/lbry/wallet/server/db/trending/ar.py @@ -25,7 +25,7 @@ TRENDING_LOG = True # Stubs -def register_trending_functions(connection): +def install(connection): check_trending_values(connection) CREATE_TREND_TABLE = "" @@ -173,7 +173,7 @@ trending_data = TrendingData() f = open("trending_ar.log", "w") f.close() -def calculate_trending(db, height, final_height, recalculate_claim_hashes): +def run(db, height, final_height, recalculate_claim_hashes): if height < final_height - 5*HALF_LIFE: trending_log("Skipping AR trending at block {h}.\n".format(h=height))