Add a timeout in SQLite retries, and if it reaches this timeout, kill the attempts.