Skip to content

Commit dfda8c6

Browse files
NGimbalkentcdodds
andauthored
feat(wal): reenables wal mode for litefs after resolution of issue (#621)
Co-authored-by: Kent C. Dodds <[email protected]>
1 parent 534641c commit dfda8c6

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

other/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ ENV CACHE_DATABASE_PATH="$LITEFS_DIR/$CACHE_DATABASE_FILENAME"
5252
ENV INTERNAL_PORT="8080"
5353
ENV PORT="8081"
5454
ENV NODE_ENV="production"
55+
# For WAL support: https://github.com/prisma/prisma-engines/issues/4675#issuecomment-1914383246
56+
ENV PRISMA_SCHEMA_DISABLE_ADVISORY_LOCK = "1"
5557

5658
# add shortcut for connecting to database CLI
5759
RUN echo "#!/bin/sh\nset -x\nsqlite3 \$DATABASE_URL" > /usr/local/bin/database-cli && chmod +x /usr/local/bin/database-cli
@@ -68,7 +70,7 @@ COPY --from=build /myapp/prisma /myapp/prisma
6870
COPY --from=build /myapp/app/components/ui/icons /myapp/app/components/ui/icons
6971

7072
# prepare for litefs
71-
COPY --from=flyio/litefs:0.5.8 /usr/local/bin/litefs /usr/local/bin/litefs
73+
COPY --from=flyio/litefs:0.5.11 /usr/local/bin/litefs /usr/local/bin/litefs
7274
ADD other/litefs.yml /etc/litefs.yml
7375
RUN mkdir -p /data ${LITEFS_DIR}
7476

other/litefs.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ exec:
3434
- cmd: npx prisma migrate deploy
3535
if-candidate: true
3636

37-
# re-enable these when this is fixed: https://github.com/superfly/litefs/issues/425
38-
# # Set the journal mode for the database to WAL. This reduces concurrency deadlock issues
39-
# - cmd: sqlite3 $DATABASE_PATH "PRAGMA journal_mode = WAL;"
40-
# if-candidate: true
41-
42-
# # Set the journal mode for the cache to WAL. This reduces concurrency deadlock issues
43-
# - cmd: sqlite3 $CACHE_DATABASE_PATH "PRAGMA journal_mode = WAL;"
44-
# if-candidate: true
37+
# Set the journal mode for the database to WAL. This reduces concurrency deadlock issues
38+
- cmd: sqlite3 $DATABASE_PATH "PRAGMA journal_mode = WAL;"
39+
if-candidate: true
40+
41+
# Set the journal mode for the cache to WAL. This reduces concurrency deadlock issues
42+
- cmd: sqlite3 $CACHE_DATABASE_PATH "PRAGMA journal_mode = WAL;"
43+
if-candidate: true
4544

4645
- cmd: npm start

0 commit comments

Comments
 (0)