admin check and thread as daemon

This commit is contained in:
callebtc 2023-02-17 16:13:06 +01:00
parent dfe15f6673
commit d504146f91
4 changed files with 18 additions and 14 deletions

View file

@ -76,12 +76,13 @@ async def subscribe_events():
await asyncio.sleep(2)
def callback(event: Event):
print(f"From {event.public_key[:3]}..{event.public_key[-3:]}: {event.content}")
# print(f"From {event.public_key[:3]}..{event.public_key[-3:]}: {event.content}")
asyncio.run(received_event_queue.put(event))
t = threading.Thread(
target=client.subscribe,
args=(callback,),
name="Nostr-event-subscription",
daemon=True,
)
t.start()