From dd1ba27708aee758610ebef49df5c3030944293a Mon Sep 17 00:00:00 2001 From: Believethehype <1097224+believethehype@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:12:59 +0200 Subject: [PATCH] readd status prints --- nostr_dvm/tasks/content_discovery_currently_popular.py | 2 ++ .../content_discovery_currently_popular_by_top_zaps.py | 2 ++ .../tasks/content_discovery_currently_popular_followers.py | 2 ++ .../tasks/content_discovery_currently_popular_topic.py | 7 ++++++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/nostr_dvm/tasks/content_discovery_currently_popular.py b/nostr_dvm/tasks/content_discovery_currently_popular.py index cb7a272..e306667 100644 --- a/nostr_dvm/tasks/content_discovery_currently_popular.py +++ b/nostr_dvm/tasks/content_discovery_currently_popular.py @@ -150,6 +150,8 @@ class DicoverContentCurrentlyPopular(DVMTaskInterface): result_list.append(e_tag.as_vec()) cli.disconnect() cli.shutdown() + print("[" + self.dvm_config.IDENTIFIER + "] Filtered " + str( + len(result_list)) + " fitting events.") return json.dumps(result_list) def post_process(self, result, event): diff --git a/nostr_dvm/tasks/content_discovery_currently_popular_by_top_zaps.py b/nostr_dvm/tasks/content_discovery_currently_popular_by_top_zaps.py index 0dda98c..86408d9 100644 --- a/nostr_dvm/tasks/content_discovery_currently_popular_by_top_zaps.py +++ b/nostr_dvm/tasks/content_discovery_currently_popular_by_top_zaps.py @@ -155,6 +155,8 @@ class DicoverContentCurrentlyPopularZaps(DVMTaskInterface): ns.finallist[event.id().to_hex()] = invoice_amount result_list = [] + print("[" + self.dvm_config.IDENTIFIER + "] Filtered " + str( + len(result_list)) + " fitting events.") finallist_sorted = sorted(ns.finallist.items(), key=lambda x: x[1], reverse=True)[:int(options["max_results"])] for entry in finallist_sorted: # print(EventId.parse(entry[0]).to_bech32() + "/" + EventId.parse(entry[0]).to_hex() + ": " + str(entry[1])) diff --git a/nostr_dvm/tasks/content_discovery_currently_popular_followers.py b/nostr_dvm/tasks/content_discovery_currently_popular_followers.py index d632267..a09fcdc 100644 --- a/nostr_dvm/tasks/content_discovery_currently_popular_followers.py +++ b/nostr_dvm/tasks/content_discovery_currently_popular_followers.py @@ -164,6 +164,8 @@ class DicoverContentCurrentlyPopularFollowers(DVMTaskInterface): result_list.append(e_tag.as_vec()) cli.connect() cli.shutdown() + print("[" + self.dvm_config.IDENTIFIER + "] Filtered " + str( + len(result_list)) + " fitting events.") return json.dumps(result_list) diff --git a/nostr_dvm/tasks/content_discovery_currently_popular_topic.py b/nostr_dvm/tasks/content_discovery_currently_popular_topic.py index 2b9fef7..8c49b75 100644 --- a/nostr_dvm/tasks/content_discovery_currently_popular_topic.py +++ b/nostr_dvm/tasks/content_discovery_currently_popular_topic.py @@ -178,6 +178,9 @@ class DicoverContentCurrentlyPopularbyTopic(DVMTaskInterface): result_list.append(e_tag.as_vec()) print(len(result_list)) + print("[" + self.dvm_config.IDENTIFIER + "] Filtered " + str( + len(result_list)) + " fitting events.") + cli.disconnect() cli.shutdown() return json.dumps(result_list) @@ -192,7 +195,9 @@ class DicoverContentCurrentlyPopularbyTopic(DVMTaskInterface): self.sync_db() self.last_schedule = Timestamp.now().as_secs() self.result = self.calculate_result(self.request_form) - #print(self.result) + + + return 1 def sync_db(self):