@@ -37,15 +37,12 @@ def printevents():
3737 print ("relaymanager subscribing" )
3838 relay_manager .add_subscription (subscription_id , filters )
3939 time .sleep (3 ) # allow the connections to open
40-
4140 print ("opening connections" ) # after this, CPU usage goes high and stays there
4241 relay_manager .open_connections ({"cert_reqs" : ssl .CERT_NONE }) # NOTE: This disables ssl certificate verification
4342 time .sleep (10 ) # allow the connections to open
44-
4543 print ("publishing:" )
4644 relay_manager .publish_message (message )
4745 time .sleep (10 ) # allow the messages to send
48-
4946 print ("printing events:" )
5047 #while relay_manager.message_pool.has_events():
5148 for _ in range (10 ):
@@ -70,13 +67,15 @@ def printevents():
7067# [DEBUG 408724546] Connecting to wss://relay.damus.io
7168# [DEBUG 408724547] Using SSL with no certificate verification
7269# 24KB is fine
73- _thread .stack_size (18 * 1024 )
74- _thread .start_new_thread (printevents , ())
75- #printevents()
70+ # somehow, if I run this in a thread, I get: can't create thread" at File "/lib/nostr/relay_manager.py", line 48, in open_connections
71+ # tried stack sizes from 18KB up to 32KB
72+ #_thread.stack_size(48*1024)
73+ #_thread.start_new_thread(printevents, ())
74+ printevents ()
7675
7776
78- import gc
79- for _ in range (50 ):
80- collect = gc .collect ()
81- print (f"MEMFREE: { gc .mem_free ()} " )
82- time .sleep (1 )
77+ # import gc
78+ # for _ in range(50):
79+ # collect = gc.collect()
80+ # print(f"MEMFREE: {gc.mem_free()}")
81+ # time.sleep(1)
0 commit comments