From 07a96c38c1860547c2706f15b8beb476f89d4595 Mon Sep 17 00:00:00 2001 From: Ivan Folgueira Bande Date: Wed, 21 Feb 2024 12:04:28 +0100 Subject: [PATCH] retention_policy_size: minor cleanup of comments and imports --- .../retention_policy/retention_policy_size.nim | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/waku/waku_archive/retention_policy/retention_policy_size.nim b/waku/waku_archive/retention_policy/retention_policy_size.nim index 7ed61d125a..21bb152df0 100644 --- a/waku/waku_archive/retention_policy/retention_policy_size.nim +++ b/waku/waku_archive/retention_policy/retention_policy_size.nim @@ -4,11 +4,9 @@ else: {.push raises: [].} import - std/times, stew/results, chronicles, - chronos, - os + chronos import ../driver, ../retention_policy @@ -19,18 +17,9 @@ logScope: # default size is 30 GiB or 32212254720.0 in bytes const DefaultRetentionSize*: int64 = 32212254720 - - type - # SizeRetentionPolicy implements auto delete as follows: - # - sizeLimit is the size in bytes the database can grow upto - # to reduce the size of the databases, remove the rows/number-of-messages - # DeleteLimit is the total number of messages to delete beyond this limit - # when the database size crosses the sizeLimit, then only a fraction of messages are kept, - # rest of the outdated message are deleted using deleteOldestMessagesNotWithinLimit(), - # upon deletion process the fragmented space is retrieve back using Vacuum process. SizeRetentionPolicy* = ref object of RetentionPolicy - sizeLimit: int64 + sizeLimit: int64 proc new*(T: type SizeRetentionPolicy, size=DefaultRetentionSize): T = SizeRetentionPolicy(