Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pip install -r requirements/production.txt
gunicorn \
--env=DJANGO_SETTINGS_MODULE=bakerydemo.settings.production \
--env=DJANGO_SECRET_KEY=demo \
--workers=1 \
--workers=4 \
bakerydemo.wsgi:application
```

Expand All @@ -35,7 +35,7 @@ uwsgi \
--env=DJANGO_SETTINGS_MODULE=bakerydemo.settings.production \
--env=DJANGO_SECRET_KEY=demo \
--http-socket=127.0.0.1:8000 \
--workers=1 \
--workers=4 \
--module=bakerydemo.wsgi
```

Expand All @@ -46,5 +46,5 @@ locust \
--headless \
--host http://127.0.0.1:8000 \
--run-time 1m \
--users 1
--users 4
```
3 changes: 3 additions & 0 deletions bakerydemo/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
# Enable persistent connections
DATABASES["default"]["CONN_MAX_AGE"] = 60

# Tweaked sqlite3 backend to avoid locked database errors
DATABASES["default"]["ENGINE"] = "bakerydemo.sqlite3"

# AWS creds may be used for S3 and/or Elasticsearch
AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID", "")
AWS_SECRET_ACCESS_KEY = os.getenv("AWS_SECRET_ACCESS_KEY", "")
Expand Down
Empty file added bakerydemo/sqlite3/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions bakerydemo/sqlite3/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.db.backends.sqlite3 import base


class DatabaseWrapper(base.DatabaseWrapper):
def _start_transaction_under_autocommit(self):
# Acquire a write lock immediately for transactions
self.cursor().execute("BEGIN IMMEDIATE")
2 changes: 1 addition & 1 deletion locustfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def view_page(self):


class WagtailEditor(BaseWagtailUser):
fixed_count = 1
fixed_count = 2

@task
def edit_page(self):
Expand Down