forked from LBRYCommunity/lbry-sdk
integrate ar trending algorithm into configurable trending system
This commit is contained in:
parent
994e70d43a
commit
790bbfcc99
2 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,8 @@
|
||||||
from . import zscore
|
from . import zscore
|
||||||
|
from . import ar
|
||||||
|
|
||||||
|
|
||||||
TRENDING_ALGORITHMS = {
|
TRENDING_ALGORITHMS = {
|
||||||
'zscore': zscore,
|
'zscore': zscore,
|
||||||
|
'ar': ar
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ TRENDING_LOG = True
|
||||||
|
|
||||||
|
|
||||||
# Stubs
|
# Stubs
|
||||||
def register_trending_functions(connection):
|
def install(connection):
|
||||||
check_trending_values(connection)
|
check_trending_values(connection)
|
||||||
|
|
||||||
CREATE_TREND_TABLE = ""
|
CREATE_TREND_TABLE = ""
|
||||||
|
@ -173,7 +173,7 @@ trending_data = TrendingData()
|
||||||
f = open("trending_ar.log", "w")
|
f = open("trending_ar.log", "w")
|
||||||
f.close()
|
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:
|
if height < final_height - 5*HALF_LIFE:
|
||||||
trending_log("Skipping AR trending at block {h}.\n".format(h=height))
|
trending_log("Skipping AR trending at block {h}.\n".format(h=height))
|
Loading…
Reference in a new issue