mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-06-25 22:40:53 +02:00
error handling for db reconciliation for content-discovery
This commit is contained in:
parent
e8bccc939a
commit
608c5fa651
@ -171,6 +171,7 @@ class DicoverContentLatestLongForm(DVMTaskInterface):
|
||||
return 1
|
||||
|
||||
async def sync_db(self):
|
||||
try:
|
||||
relaylimits = RelayLimits.disable()
|
||||
opts = (Options().wait_for_send(False).send_timeout(
|
||||
timedelta(seconds=self.dvm_config.RELAY_LONG_TIMEOUT))).relay_limits(relaylimits)
|
||||
@ -202,7 +203,8 @@ class DicoverContentLatestLongForm(DVMTaskInterface):
|
||||
if self.dvm_config.LOGLEVEL.value >= LogLevel.DEBUG.value:
|
||||
print(
|
||||
"[" + self.dvm_config.NIP89.NAME + "] Done Syncing Notes of the last " + str(self.db_since) + " seconds..")
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
# 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
|
||||
|
@ -171,6 +171,7 @@ class DicoverContentLatestWiki(DVMTaskInterface):
|
||||
return 1
|
||||
|
||||
async def sync_db(self):
|
||||
try:
|
||||
relaylimits = RelayLimits.disable()
|
||||
opts = (Options().wait_for_send(False).send_timeout(
|
||||
timedelta(seconds=self.dvm_config.RELAY_LONG_TIMEOUT))).relay_limits(relaylimits)
|
||||
@ -202,7 +203,8 @@ class DicoverContentLatestWiki(DVMTaskInterface):
|
||||
if self.dvm_config.LOGLEVEL.value >= LogLevel.DEBUG.value:
|
||||
print(
|
||||
"[" + self.dvm_config.NIP89.NAME + "] Done Syncing Notes of the last " + str(self.db_since) + " seconds..")
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
# 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
|
||||
|
@ -170,6 +170,7 @@ class DicoverContentCurrentlyPopular(DVMTaskInterface):
|
||||
return 0
|
||||
|
||||
async def sync_db(self):
|
||||
try:
|
||||
opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_LONG_TIMEOUT)))
|
||||
sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
|
||||
keys = Keys.parse(sk.to_hex())
|
||||
@ -200,7 +201,8 @@ class DicoverContentCurrentlyPopular(DVMTaskInterface):
|
||||
if self.dvm_config.LOGLEVEL.value >= LogLevel.DEBUG.value:
|
||||
print(
|
||||
"[" + self.dvm_config.NIP89.NAME + "] Done Syncing Notes of the last " + str(self.db_since) + " seconds..")
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
# 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
|
||||
|
@ -225,6 +225,7 @@ class DicoverContentCurrentlyPopularZaps(DVMTaskInterface):
|
||||
return 1
|
||||
|
||||
async def sync_db(self):
|
||||
try:
|
||||
opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_LONG_TIMEOUT)))
|
||||
sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
|
||||
keys = Keys.parse(sk.to_hex())
|
||||
@ -255,7 +256,8 @@ class DicoverContentCurrentlyPopularZaps(DVMTaskInterface):
|
||||
if self.dvm_config.LOGLEVEL.value >= LogLevel.DEBUG.value:
|
||||
print(
|
||||
"[" + self.dvm_config.NIP89.NAME + "] Done Syncing Notes of the last " + str(self.db_since) + " seconds..")
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
# 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
|
||||
|
@ -194,6 +194,7 @@ class DicoverContentCurrentlyPopularFollowers(DVMTaskInterface):
|
||||
|
||||
|
||||
async def sync_db(self):
|
||||
try:
|
||||
opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_LONG_TIMEOUT)))
|
||||
sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
|
||||
keys = Keys.parse(sk.to_hex())
|
||||
@ -225,6 +226,8 @@ class DicoverContentCurrentlyPopularFollowers(DVMTaskInterface):
|
||||
if self.dvm_config.LOGLEVEL.value >= LogLevel.DEBUG.value:
|
||||
print("[" + self.dvm_config.NIP89.NAME + "] Done Syncing Notes of the last " + str(
|
||||
self.db_since) + " seconds..")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
# We build an example here that we can call by either calling this file directly from the main directory,
|
||||
|
@ -245,6 +245,7 @@ class DicoverContentCurrentlyPopularGallery(DVMTaskInterface):
|
||||
return 0
|
||||
|
||||
async def sync_db(self):
|
||||
try:
|
||||
opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_LONG_TIMEOUT)))
|
||||
sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
|
||||
keys = Keys.parse(sk.to_hex())
|
||||
@ -274,7 +275,8 @@ class DicoverContentCurrentlyPopularGallery(DVMTaskInterface):
|
||||
if self.dvm_config.LOGLEVEL.value >= LogLevel.DEBUG.value:
|
||||
print(
|
||||
"[" + self.dvm_config.NIP89.NAME + "] Done Syncing Notes of the last " + str(self.db_since) + " seconds..")
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
# 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
|
||||
|
@ -219,6 +219,7 @@ class DicoverContentCurrentlyPopularMostr(DVMTaskInterface):
|
||||
return 0
|
||||
|
||||
async def sync_db(self):
|
||||
try:
|
||||
opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_LONG_TIMEOUT)))
|
||||
sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
|
||||
keys = Keys.parse(sk.to_hex())
|
||||
@ -268,6 +269,8 @@ class DicoverContentCurrentlyPopularMostr(DVMTaskInterface):
|
||||
print(
|
||||
"[" + self.dvm_config.NIP89.NAME + "] Done Syncing Notes of the last " + str(
|
||||
self.db_since) + " seconds..")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
# We build an example here that we can call by either calling this file directly from the main directory,
|
||||
|
@ -221,6 +221,7 @@ class DicoverContentCurrentlyPopularNonFollowers(DVMTaskInterface):
|
||||
return 1
|
||||
|
||||
async def sync_db(self):
|
||||
try:
|
||||
opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_LONG_TIMEOUT)))
|
||||
sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
|
||||
keys = Keys.parse(sk.to_hex())
|
||||
@ -251,7 +252,8 @@ class DicoverContentCurrentlyPopularNonFollowers(DVMTaskInterface):
|
||||
if self.dvm_config.LOGLEVEL.value >= LogLevel.DEBUG.value:
|
||||
print(
|
||||
"[" + self.dvm_config.NIP89.NAME + "] Done Syncing Notes of the last " + str(self.db_since) + " seconds..")
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
# 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
|
||||
|
@ -188,6 +188,7 @@ class DicoverContentCurrentlyPopularbyTopic(DVMTaskInterface):
|
||||
return 1
|
||||
|
||||
async def sync_db(self):
|
||||
try:
|
||||
opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_LONG_TIMEOUT)))
|
||||
sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
|
||||
keys = Keys.parse(sk.to_hex())
|
||||
@ -216,9 +217,10 @@ class DicoverContentCurrentlyPopularbyTopic(DVMTaskInterface):
|
||||
Timestamp.now().as_secs() - self.db_since))) # Clear old events so db doesn't get too full.
|
||||
await cli.shutdown()
|
||||
if self.dvm_config.LOGLEVEL.value >= LogLevel.DEBUG.value:
|
||||
print(
|
||||
"[" + self.dvm_config.NIP89.NAME + "] Done Syncing Notes of the last " + str(self.db_since) + " seconds..")
|
||||
print("[" + self.dvm_config.NIP89.NAME + "] Done Syncing Notes of the last " + str(self.db_since) + " seconds..")
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
# 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
|
||||
|
2
setup.py
2
setup.py
@ -1,6 +1,6 @@
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
VERSION = '0.8.6'
|
||||
VERSION = '0.8.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')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user