Page MenuHomeSoftware Heritage

D8300.id29972.diff
No OneTemporary

D8300.id29972.diff

diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
@@ -13,7 +13,7 @@
docs/build/
docs/uri-scheme.md
docs/dev-info.md
-*.sqlite3
+*.sqlite3*
.vscode/
.directory
node_modules/
diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js
--- a/cypress/plugins/index.js
+++ b/cypress/plugins/index.js
@@ -35,7 +35,9 @@
};
function getDatabase() {
- return new sqlite3.Database('./swh-web-test.sqlite3');
+ const db = new sqlite3.Database('./swh-web-test.sqlite3');
+ db.run('PRAGMA journal_mode = WAL;');
+ return db;
}
module.exports = (on, config) => {
diff --git a/swh/web/settings/common.py b/swh/web/settings/common.py
--- a/swh/web/settings/common.py
+++ b/swh/web/settings/common.py
@@ -132,6 +132,9 @@
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": swh_web_config.get("development_db", ""),
+ "OPTIONS": {
+ "timeout": 20, # in seconds
+ },
}
}
diff --git a/swh/web/settings/tests.py b/swh/web/settings/tests.py
--- a/swh/web/settings/tests.py
+++ b/swh/web/settings/tests.py
@@ -129,6 +129,15 @@
settings.DATABASES["default"].update(
{"ENGINE": "django.db.backends.sqlite3", "NAME": "swh-web-test.sqlite3"}
)
+
+ from django.db.backends.signals import connection_created
+
+ def activate_wal_journal_mode(sender, connection, **kwargs):
+ cursor = connection.cursor()
+ cursor.execute("PRAGMA journal_mode = WAL;")
+
+ connection_created.connect(activate_wal_journal_mode)
+
else:
# Silent DEBUG output when running unit tests
LOGGING["handlers"]["console"]["level"] = "INFO" # type: ignore

File Metadata

Mime Type
text/plain
Expires
Wed, Jul 2, 10:44 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3232430

Event Timeline