Skip to contents

Ensures exclusive access to a user's account tree by creating a lock file. Waits until the lock is released or a timeout is reached. Uses the plugin architecture to support multiple storage backends.

Usage

with_account_lock(user_id, expr, timeout = 1800)

Arguments

user_id

The user ID whose account tree should be locked.

expr

An expression to evaluate within the lock.

timeout

Maximum time in seconds to wait for the lock. Default is 1800.

Value

Returns the result of evaluating `expr`.