From 9fef72ae0ca1459f7902654cd0f0c27e6097e41c Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 10 Feb 2023 10:10:01 +0200 Subject: [PATCH] doc: add comment --- crud.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crud.py b/crud.py index 6b7a893..ec16bf0 100644 --- a/crud.py +++ b/crud.py @@ -120,6 +120,8 @@ async def get_event(relay_id: str, id: str) -> Optional[NostrEvent]: return event async def get_storage_for_public_key(relay_id: str, pubkey: str) -> int: + """Returns the storage space in bytes for all the events of a public key. Deleted events are also counted""" + row = await db.fetchone("SELECT SUM(size) FROM nostrrelay.events WHERE relay_id = ? AND pubkey = ?", (relay_id, pubkey,)) if not row: return 0