diff --git a/nostr_dvm/dvm.py b/nostr_dvm/dvm.py index 351d353..6074765 100644 --- a/nostr_dvm/dvm.py +++ b/nostr_dvm/dvm.py @@ -401,6 +401,7 @@ class DVM: post_processed = dvm.post_process(data, original_event) send_nostr_reply_event(post_processed, original_event.as_json()) except Exception as e: + print(e) # Zapping back by error in post-processing is a risk for the DVM because work has been done, # but maybe something with parsing/uploading failed. Try to avoid errors here as good as possible send_job_status_reaction(original_event, "error", @@ -596,9 +597,11 @@ class DVM: post_processed = dvm.post_process(result, job_event) send_nostr_reply_event(post_processed, job_event.as_json()) except Exception as e: + print(e) send_job_status_reaction(job_event, "error", content=str(e), dvm_config=self.dvm_config) except Exception as e: + print(e) # we could send the exception here to the user, but maybe that's not a good idea after all. send_job_status_reaction(job_event, "error", content=result, dvm_config=self.dvm_config) diff --git a/nostr_dvm/tasks/advanced_search.py b/nostr_dvm/tasks/advanced_search.py index b879452..5a04963 100644 --- a/nostr_dvm/tasks/advanced_search.py +++ b/nostr_dvm/tasks/advanced_search.py @@ -1,7 +1,7 @@ import json import os from datetime import timedelta -from nostr_sdk import Client, Timestamp, PublicKey, Tag, Keys, Options, SecretKey, NostrSigner, Kind +from nostr_sdk import Client, Timestamp, PublicKey, Tag, Keys, Options, SecretKey, NostrSigner, Kind, RelayOptions from nostr_dvm.interfaces.dvmtaskinterface import DVMTaskInterface, process_venv from nostr_dvm.utils.admin_utils import AdminConfig @@ -95,7 +95,9 @@ class AdvancedSearch(DVMTaskInterface): signer = NostrSigner.keys(keys) cli = Client.with_opts(signer, opts) - cli.add_relay(options["relay"]) + ropts = RelayOptions().ping(False) + cli.add_relay_with_opts(options["relay"], ropts) + cli.connect() #earch_since_seconds = int(options["since"]) * 24 * 60 * 60