fixes wot option

This commit is contained in:
Believethehype 2024-09-19 23:28:12 +02:00
parent 00f24f756f
commit 03a2fa1d77
5 changed files with 8 additions and 5 deletions

2
.idea/dvm.iml generated
View File

@ -14,7 +14,7 @@
<excludeFolder url="file://$MODULE_DIR$/p1234" />
<excludeFolder url="file://$MODULE_DIR$/p23" />
</content>
<orderEntry type="jdk" jdkName="Python 3.11 (dvm)" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.12 (dvm)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

2
.idea/misc.xml generated
View File

@ -3,5 +3,5 @@
<component name="Black">
<option name="sdkName" value="Python 3.10 (dvm)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (dvm)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (dvm)" project-jdk-type="Python SDK" />
</project>

View File

@ -8,7 +8,7 @@ from itertools import islice
import networkx as nx
from nostr_sdk import Client, Timestamp, PublicKey, Tag, Keys, Options, SecretKey, NostrSigner, NostrDatabase, \
ClientBuilder, Filter, NegentropyOptions, NegentropyDirection, init_logger, LogLevel, Event, EventId, Kind, \
RelayLimits
RelayLimits, RelayFilteringMode
from nostr_dvm.interfaces.dvmtaskinterface import DVMTaskInterface, process_venv
from nostr_dvm.utils import definitions
@ -132,11 +132,14 @@ class DicoverContentDBUpdateScheduler(DVMTaskInterface):
try:
relaylimits = RelayLimits.disable()
opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_LONG_TIMEOUT))).relay_limits(relaylimits)
if self.dvm_config.WOT_FILTERING:
opts = opts.filtering_mode(RelayFilteringMode.WHITELIST)
sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
keys = Keys.parse(sk.to_hex())
signer = NostrSigner.keys(keys)
if self.database is None:
self.database = NostrDatabase.lmdb(self.db_name)
cli = ClientBuilder().signer(signer).database(self.database).opts(opts).build()
for relay in self.dvm_config.RECONCILE_DB_RELAY_LIST:

View File

@ -1,6 +1,6 @@
from setuptools import setup, find_packages
VERSION = '0.8.20'
VERSION = '0.8.21'
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')

View File

@ -621,7 +621,7 @@ def playground():
admin_config_db_scheduler= AdminConfig()
options_animal = {
"db_name": main_db,
"db_since": 48 * 60 * 60, # 48h since gmt,
"db_since": 6 * 60 * 60, # 48h since gmt,
"personalized": False,
"logger": False}
image = ""