Skip to content

Commit

Permalink
Wait for transform() to run using future.complete()
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jan 25, 2024
1 parent 1d53b13 commit 1a0e0ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion datasette_upload_csvs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,10 @@ def transform_columns(conn):
database = sqlite_utils.Database(conn)
database[table_name].transform(types=tracker.types)

asyncio.run_coroutine_threadsafe(
future = asyncio.run_coroutine_threadsafe(
db.execute_write_fn(transform_columns), event_loop
)
future.result()
except Exception as error:

def insert_error(conn):
Expand Down

0 comments on commit 1a0e0ab

Please sign in to comment.