compact_vault Method
Compacts the vault.
Syntax
def compact_vault() -> bool: ...
Remarks
This method triggers vault compaction, a process that shrinks a vault's overall size by truncating its free space. If the compacting operation completes successfully, this method returns True; otherwise it returns False.
Compaction involves physically moving a vault's occupied pages to the beginning of the vault, and then truncating the unoccupied pages from the end of the vault. The runtime of a compacting operation depends on a number of factors, and it's possible for it to be interrupted by other vault operations.
Compaction occurs automatically when the vault's free space percentage exceeds the threshold specified by the auto_compact_at property. Applications can also use the AutoCompactDelay configuration setting to add a delay to the automatic compaction trigger.
Note that a vault opened in read_only mode cannot be compacted, automatically or explicitly.
Note: This method can only be called when active is True, and cannot be called within events.