[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [NativeSqlite](https://evolu.dev/docs/api-reference/common/NativeSqlite) › retryWhileHeld

```ts
function retryWhileHeld<T, E>(attempt: () => Result<T, E>): Task<T, E>;
```

Defined in: [packages/common/src/NativeSqlite.ts:399](https://github.com/evoluhq/evolu/blob/1ef91d4e21b74fa0c122e48558188dc42676c429/packages/common/src/NativeSqlite.ts#L399)

Runs `attempt` at once and, until one returns ok, again 50 ms after an
attempt that returned an error, then after twice the previous delay, up to a
second. It returns the error of an attempt that ends
[databaseHeldTimeout](https://evolu.dev/docs/api-reference/common/Sqlite/variables/databaseHeldTimeout) or more after the first started, as the web waits
for a database another context holds.