more options, faster update für content dvms

This commit is contained in:
Believethehype 2024-05-17 22:51:15 +02:00
parent 104880ad31
commit 73f071b6ae
5 changed files with 13 additions and 11 deletions

View File

@ -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, # 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 # 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 # 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 = build_default_config(identifier)
dvm_config.USE_OWN_VENV = False dvm_config.USE_OWN_VENV = False
dvm_config.SHOWLOG = True 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 dvm_config.UPDATE_DATABASE = update_db
# Activate these to use a subscription based model instead # Activate these to use a subscription based model instead
# dvm_config.SUBSCRIPTION_REQUIRED = True # 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) 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 = build_default_config(identifier)
dvm_config.USE_OWN_VENV = False dvm_config.USE_OWN_VENV = False
dvm_config.SHOWLOG = True 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 dvm_config.UPDATE_DATABASE = update_db
# Activate these to use a subscription based model instead # Activate these to use a subscription based model instead
# dvm_config.SUBSCRIPTION_DAILY_COST = 1 # dvm_config.SUBSCRIPTION_DAILY_COST = 1

View File

@ -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, # 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 # 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 # 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 = build_default_config(identifier)
dvm_config.USE_OWN_VENV = False dvm_config.USE_OWN_VENV = False
dvm_config.SHOWLOG = True 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 dvm_config.UPDATE_DATABASE = update_db
# Activate these to use a subscription based model instead # Activate these to use a subscription based model instead
# dvm_config.SUBSCRIPTION_REQUIRED = True # dvm_config.SUBSCRIPTION_REQUIRED = True

View File

@ -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, # 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 # 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 # 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 = build_default_config(identifier)
dvm_config.USE_OWN_VENV = False dvm_config.USE_OWN_VENV = False
dvm_config.SHOWLOG = True 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 dvm_config.UPDATE_DATABASE = update_db
# Activate these to use a subscription based model instead # Activate these to use a subscription based model instead
# dvm_config.SUBSCRIPTION_REQUIRED = True # dvm_config.SUBSCRIPTION_REQUIRED = True

View File

@ -1,6 +1,6 @@
from setuptools import setup, find_packages 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' 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') LONG_DESCRIPTION = ('A framework to build and run Nostr NIP90 Data Vending Machines. See the github repository for more information')

View File

@ -63,7 +63,7 @@ def playground():
"discovery_content_garden", "discovery_content_garden",
admin_config_plants, options_plants, admin_config_plants, options_plants,
image, image,
description, cost, custom_processing_msg, description, 180, cost, custom_processing_msg,
update_db) update_db)
discovery_test_sub.run() discovery_test_sub.run()
@ -104,7 +104,7 @@ def playground():
"discovery_content_fluffy", "discovery_content_fluffy",
admin_config_animals, options_animal, admin_config_animals, options_animal,
image, image,
description, cost, custom_processing_msg, description,180, cost, custom_processing_msg,
update_db) update_db)
discovery_animals.run() discovery_animals.run()
@ -128,6 +128,7 @@ def playground():
admin_config=admin_config_followers, admin_config=admin_config_followers,
options=options_followers_popular, options=options_followers_popular,
cost=cost, cost=cost,
update_rate=180,
processing_msg=custom_processing_msg, processing_msg=custom_processing_msg,
update_db=update_db) update_db=update_db)
discovery_followers.run() discovery_followers.run()
@ -150,6 +151,7 @@ def playground():
admin_config=admin_config_global_popular, admin_config=admin_config_global_popular,
options=options_global_popular, options=options_global_popular,
cost=cost, cost=cost,
update_rate=180,
processing_msg=custom_processing_msg, processing_msg=custom_processing_msg,
update_db=update_db) update_db=update_db)
discovery_global.run() discovery_global.run()