Skip to content

Commit

Permalink
retention_policy_size: minor cleanup of comments and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status committed Feb 21, 2024
1 parent 021a1af commit 07a96c3
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions waku/waku_archive/retention_policy/retention_policy_size.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ else:
{.push raises: [].}

import
std/times,
stew/results,
chronicles,
chronos,
os
chronos
import
../driver,
../retention_policy
Expand All @@ -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(
Expand Down

0 comments on commit 07a96c3

Please sign in to comment.