home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 674451012

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/datasette/issues/935#issuecomment-674451012 https://api.github.com/repos/simonw/datasette/issues/935 674451012 MDEyOklzc3VlQ29tbWVudDY3NDQ1MTAxMg== 9599 2020-08-15T21:56:13Z 2020-08-15T21:56:13Z OWNER

This implementation seems to fix it, need to work out how to test though. ```diff diff --git a/datasette/database.py b/datasette/database.py index ffa7a79..7ba1456 100644 --- a/datasette/database.py +++ b/datasette/database.py @@ -89,14 +89,22 @@ class Database: def _execute_writes(self): # Infinite looping thread that protects the single write connection # to this database - conn = self.connect(write=True) + conn_exception = None + conn = None + try: + conn = self.connect(write=True) + except Exception as e: + conn_exception = e while True: task = self._write_queue.get() - try: - result = task.fn(conn) - except Exception as e: - print(e) - result = e + if conn_exception is not None: + result = conn_exception + else: + try: + result = task.fn(conn) + except Exception as e: + print(e) + result = e task.reply_queue.sync_q.put(result)

 async def execute_fn(self, fn):

```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
679646710  
Powered by Datasette · Queries took 0.788ms · About: github-to-sqlite