admin check and thread as daemon
This commit is contained in:
parent
dfe15f6673
commit
d504146f91
4 changed files with 18 additions and 14 deletions
3
tasks.py
3
tasks.py
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue