Skip to content

Commit

Permalink
bla
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsasha committed Aug 16, 2020
1 parent 69a25f0 commit b164628
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion irrd/storage/database_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def refresh_connection(self) -> None:
except Exception: # pragma: no cover
pass
self._connection = get_engine().connect()
if not self.readonly:
if self.readonly:
self._connection.execution_options(isolation_level="AUTOCOMMIT")
else:
self._start_transaction()

def _start_transaction(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion irrd/storage/preload.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def update(self, mock_database_handler=None) -> None:

if not mock_database_handler: # pragma: no cover
from .database_handler import DatabaseHandler
dh = DatabaseHandler()
dh = DatabaseHandler(readonly=True)
else:
dh = mock_database_handler

Expand Down

0 comments on commit b164628

Please sign in to comment.