From fcf796b80021b167f1057ed3509cd34376cdaaf5 Mon Sep 17 00:00:00 2001 From: Believethehype <1097224+believethehype@users.noreply.github.com> Date: Thu, 13 Jun 2024 10:58:15 +0200 Subject: [PATCH] fix missing await --- nostr_dvm/tasks/content_discovery_currently_latest_longform.py | 2 +- nostr_dvm/tasks/content_discovery_currently_popular.py | 2 +- .../tasks/content_discovery_currently_popular_by_top_zaps.py | 2 +- nostr_dvm/utils/nostr_utils.py | 2 +- setup.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nostr_dvm/tasks/content_discovery_currently_latest_longform.py b/nostr_dvm/tasks/content_discovery_currently_latest_longform.py index 304a5ac..18a0d06 100644 --- a/nostr_dvm/tasks/content_discovery_currently_latest_longform.py +++ b/nostr_dvm/tasks/content_discovery_currently_latest_longform.py @@ -96,7 +96,7 @@ class DicoverContentLatestLongForm(DVMTaskInterface): async def process(self, request_form): # if the dvm supports individual results, recalculate it every time for the request if self.personalized: - return self.calculate_result(request_form) + return await self.calculate_result(request_form) # else return the result that gets updated once every scheduled update. In this case on database update. else: return self.result diff --git a/nostr_dvm/tasks/content_discovery_currently_popular.py b/nostr_dvm/tasks/content_discovery_currently_popular.py index d6b1815..fc0702e 100644 --- a/nostr_dvm/tasks/content_discovery_currently_popular.py +++ b/nostr_dvm/tasks/content_discovery_currently_popular.py @@ -98,7 +98,7 @@ class DicoverContentCurrentlyPopular(DVMTaskInterface): async def process(self, request_form): # if the dvm supports individual results, recalculate it every time for the request if self.personalized: - return self.calculate_result(request_form) + return await self.calculate_result(request_form) # else return the result that gets updated once every scheduled update. In this case on database update. else: return self.result 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 163dd8b..6e4e7ac 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 @@ -98,7 +98,7 @@ class DicoverContentCurrentlyPopularZaps(DVMTaskInterface): async def process(self, request_form): # if the dvm supports individual results, recalculate it every time for the request if self.personalized: - return self.calculate_result(request_form) + return await self.calculate_result(request_form) # else return the result that gets updated once every scheduled update. In this case on database update. else: return self.result diff --git a/nostr_dvm/utils/nostr_utils.py b/nostr_dvm/utils/nostr_utils.py index 20b404e..28b6482 100644 --- a/nostr_dvm/utils/nostr_utils.py +++ b/nostr_dvm/utils/nostr_utils.py @@ -42,7 +42,7 @@ def get_event_by_id(event_id: str, client: Client, config=None) -> Event | None: return None async def get_events_async(client, filter, timeout): - events = client.get_events_of([filter], timedelta(seconds=timeout)) + events = await client.get_events_of([filter], timedelta(seconds=timeout)) return events diff --git a/setup.py b/setup.py index 802b5b4..f2a9598 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -VERSION = '0.6.6' +VERSION = '0.6.7' DESCRIPTION = 'A framework to build and run Nostr NIP90 Data Vending Machines' LONG_DESCRIPTION = ('A framework to build and run Nostr NIP90 Data Vending Machines. See the github repository for more information')