diff --git a/nostr_dvm/tasks/content_discovery_currently_popular.py b/nostr_dvm/tasks/content_discovery_currently_popular.py index a297788..6ef5b7b 100644 --- a/nostr_dvm/tasks/content_discovery_currently_popular.py +++ b/nostr_dvm/tasks/content_discovery_currently_popular.py @@ -202,11 +202,11 @@ class DicoverContentCurrentlyPopular(DVMTaskInterface): # We build an example here that we can call by either calling this file directly from the main directory, # or by adding it to our playground. You can call the example and adjust it to your needs or redefine it in the # playground or elsewhere -def build_example(name, identifier, admin_config, options, cost=0, processing_msg=None, update_db=True): +def build_example(name, identifier, admin_config, options, cost=0, update_rate=180, processing_msg=None, update_db=True): dvm_config = build_default_config(identifier) dvm_config.USE_OWN_VENV = False dvm_config.SHOWLOG = True - dvm_config.SCHEDULE_UPDATES_SECONDS = 600 # Every 10 minutes + dvm_config.SCHEDULE_UPDATES_SECONDS = update_rate # Every 10 minutes dvm_config.UPDATE_DATABASE = update_db # Activate these to use a subscription based model instead # dvm_config.SUBSCRIPTION_REQUIRED = True @@ -247,11 +247,11 @@ def build_example(name, identifier, admin_config, options, cost=0, processing_ admin_config=admin_config, options=options) -def build_example_subscription(name, identifier, admin_config, options, processing_msg=None, update_db=True): +def build_example_subscription(name, identifier, admin_config, options, update_rate=180, processing_msg=None, update_db=True): dvm_config = build_default_config(identifier) dvm_config.USE_OWN_VENV = False dvm_config.SHOWLOG = True - dvm_config.SCHEDULE_UPDATES_SECONDS = 180 # Every 3 minutes + dvm_config.SCHEDULE_UPDATES_SECONDS = update_rate # Every 3 minutes dvm_config.UPDATE_DATABASE = update_db # Activate these to use a subscription based model instead # dvm_config.SUBSCRIPTION_DAILY_COST = 1 diff --git a/nostr_dvm/tasks/content_discovery_currently_popular_followers.py b/nostr_dvm/tasks/content_discovery_currently_popular_followers.py index 59dca50..e25faa8 100644 --- a/nostr_dvm/tasks/content_discovery_currently_popular_followers.py +++ b/nostr_dvm/tasks/content_discovery_currently_popular_followers.py @@ -218,11 +218,11 @@ class DicoverContentCurrentlyPopularFollowers(DVMTaskInterface): # We build an example here that we can call by either calling this file directly from the main directory, # or by adding it to our playground. You can call the example and adjust it to your needs or redefine it in the # playground or elsewhere -def build_example(name, identifier, admin_config, options, cost=0, processing_msg=None, update_db=True): +def build_example(name, identifier, admin_config, options, cost=0, update_rate=300, processing_msg=None, update_db=True): dvm_config = build_default_config(identifier) dvm_config.USE_OWN_VENV = False dvm_config.SHOWLOG = True - dvm_config.SCHEDULE_UPDATES_SECONDS = 600 # Every 10 minutes + dvm_config.SCHEDULE_UPDATES_SECONDS = update_rate # Every x seconds dvm_config.UPDATE_DATABASE = update_db # Activate these to use a subscription based model instead # dvm_config.SUBSCRIPTION_REQUIRED = True diff --git a/nostr_dvm/tasks/content_discovery_currently_popular_topic.py b/nostr_dvm/tasks/content_discovery_currently_popular_topic.py index 9f1c554..638c67a 100644 --- a/nostr_dvm/tasks/content_discovery_currently_popular_topic.py +++ b/nostr_dvm/tasks/content_discovery_currently_popular_topic.py @@ -233,11 +233,11 @@ class DicoverContentCurrentlyPopularbyTopic(DVMTaskInterface): # We build an example here that we can call by either calling this file directly from the main directory, # or by adding it to our playground. You can call the example and adjust it to your needs or redefine it in the # playground or elsewhere -def build_example(name, identifier, admin_config, options, image, description, cost=0, processing_msg=None, update_db=True): +def build_example(name, identifier, admin_config, options, image, description, update_rate=600, cost=0, processing_msg=None, update_db=True): dvm_config = build_default_config(identifier) dvm_config.USE_OWN_VENV = False dvm_config.SHOWLOG = True - dvm_config.SCHEDULE_UPDATES_SECONDS = 600 # Every 10 minutes + dvm_config.SCHEDULE_UPDATES_SECONDS = update_rate # Every 10 minutes dvm_config.UPDATE_DATABASE = update_db # Activate these to use a subscription based model instead # dvm_config.SUBSCRIPTION_REQUIRED = True diff --git a/setup.py b/setup.py index 98ec34a..ede265c 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -VERSION = '0.4.4' +VERSION = '0.4.5' 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') diff --git a/tests/discovery.py b/tests/discovery.py index 4171dba..771eb0e 100644 --- a/tests/discovery.py +++ b/tests/discovery.py @@ -63,7 +63,7 @@ def playground(): "discovery_content_garden", admin_config_plants, options_plants, image, - description, cost, custom_processing_msg, + description, 180, cost, custom_processing_msg, update_db) discovery_test_sub.run() @@ -104,7 +104,7 @@ def playground(): "discovery_content_fluffy", admin_config_animals, options_animal, image, - description, cost, custom_processing_msg, + description,180, cost, custom_processing_msg, update_db) discovery_animals.run() @@ -128,6 +128,7 @@ def playground(): admin_config=admin_config_followers, options=options_followers_popular, cost=cost, + update_rate=180, processing_msg=custom_processing_msg, update_db=update_db) discovery_followers.run() @@ -150,6 +151,7 @@ def playground(): admin_config=admin_config_global_popular, options=options_global_popular, cost=cost, + update_rate=180, processing_msg=custom_processing_msg, update_db=update_db) discovery_global.run()