import time
import threading
from nostr.relay_manager import RelayManager
import logging
logging.basicConfig(level=logging.INFO)
def main():
relay_manager = RelayManager()
relay_manager.add_relay("wss://nostr.zebedee.cloud")
relay_manager.add_relay("wss://nostr.bitcoiner.social")
logging.info(f"Connections opened: ") # add more logging info
time.sleep(1.25) # allow the connections to open
threading.Thread(target=run, args=(relay_manager,)).start()
def run(relay_manager):
with relay_manager.lock:
relay_manager.close_all_relay_connections()
logging.info(f"Connections closed ...")
I saw a similar error already reported. I can't figure out how to fix it, it could easily be my own error as I am not very experienced using threading or locks.
I am getting this error:
Using this code:
I saw a similar error already reported. I can't figure out how to fix it, it could easily be my own error as I am not very experienced using threading or locks.
Thanks!