pub async fn prepare_database(mongo: &Client) -> Result<(), Error>
Expand description
Prepares MongoDB collection to store locks.
Creates TTL index to remove old records after they expire.
The Lock itself does not relies on this index, because MongoDB can remove documents with some significant delay.