Batch insert entries in nostr size test

This commit is contained in:
thePR0M3TH3AN
2025-07-02 15:01:44 -04:00
parent 205c1d3392
commit d8585bf4ef

View File

@@ -41,17 +41,20 @@ def test_nostr_index_size_limits():
delay = float(os.getenv("NOSTR_TEST_DELAY", "5")) delay = float(os.getenv("NOSTR_TEST_DELAY", "5"))
size = 16 size = 16
batch = 100
entry_count = 0 entry_count = 0
max_payload = 60 * 1024 max_payload = 60 * 1024
try: try:
while True: while True:
entry_mgr.add_entry( for _ in range(batch):
website_name=f"site-{entry_count + 1}", entry_mgr.add_entry(
length=12, website_name=f"site-{entry_count + 1}",
username="u" * size, length=12,
url="https://example.com/" + "a" * size, username="u" * size,
) url="https://example.com/" + "a" * size,
entry_count += 1 )
entry_count += 1
encrypted = vault.get_encrypted_index() encrypted = vault.get_encrypted_index()
payload_size = len(encrypted) if encrypted else 0 payload_size = len(encrypted) if encrypted else 0
published = client.publish_json_to_nostr(encrypted or b"") published = client.publish_json_to_nostr(encrypted or b"")