From 39996d761209e3b099904d6c44d432e7a39bbd4d Mon Sep 17 00:00:00 2001 From: "Brendon J. Brewer" Date: Wed, 5 Feb 2020 07:47:38 +1300 Subject: [PATCH] Only create file during install if logging is turned on --- lbry/wallet/server/db/trending/ar.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lbry/wallet/server/db/trending/ar.py b/lbry/wallet/server/db/trending/ar.py index 748a57ad4..bc20da4c7 100644 --- a/lbry/wallet/server/db/trending/ar.py +++ b/lbry/wallet/server/db/trending/ar.py @@ -28,6 +28,11 @@ TRENDING_LOG = True def install(connection): check_trending_values(connection) + if TRENDING_LOG: + f = open("trending_ar.log", "w") + f.close() + + CREATE_TREND_TABLE = "" @@ -53,8 +58,6 @@ def check_trending_values(connection): COMMIT;""") print("done.") - # Create the index - c.execute("create index if not exists claim_id_only_idx on claim (claim_id);") def spike_height(trending_score, x, x_old, time_boost=1.0): @@ -170,8 +173,6 @@ def test_trending(): # One global instance # pylint: disable=C0103 trending_data = TrendingData() -f = open("trending_ar.log", "w") -f.close() def run(db, height, final_height, recalculate_claim_hashes):