Skip to content

Commit

Permalink
feat(wal): reenables wal mode for litefs after resolution of issue (#621
Browse files Browse the repository at this point in the history
)

Co-authored-by: Kent C. Dodds <me@kentcdodds.com>
  • Loading branch information
NGimbal and kentcdodds authored Feb 27, 2024
1 parent 534641c commit dfda8c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 3 additions & 1 deletion other/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ ENV CACHE_DATABASE_PATH="$LITEFS_DIR/$CACHE_DATABASE_FILENAME"
ENV INTERNAL_PORT="8080"
ENV PORT="8081"
ENV NODE_ENV="production"
# For WAL support: https://github.com/prisma/prisma-engines/issues/4675#issuecomment-1914383246
ENV PRISMA_SCHEMA_DISABLE_ADVISORY_LOCK = "1"

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

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

Expand Down
15 changes: 7 additions & 8 deletions other/litefs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ exec:
- cmd: npx prisma migrate deploy
if-candidate: true

# re-enable these when this is fixed: https://github.com/superfly/litefs/issues/425
# # Set the journal mode for the database to WAL. This reduces concurrency deadlock issues
# - cmd: sqlite3 $DATABASE_PATH "PRAGMA journal_mode = WAL;"
# if-candidate: true

# # Set the journal mode for the cache to WAL. This reduces concurrency deadlock issues
# - cmd: sqlite3 $CACHE_DATABASE_PATH "PRAGMA journal_mode = WAL;"
# if-candidate: true
# Set the journal mode for the database to WAL. This reduces concurrency deadlock issues
- cmd: sqlite3 $DATABASE_PATH "PRAGMA journal_mode = WAL;"
if-candidate: true

# Set the journal mode for the cache to WAL. This reduces concurrency deadlock issues
- cmd: sqlite3 $CACHE_DATABASE_PATH "PRAGMA journal_mode = WAL;"
if-candidate: true

- cmd: npm start

0 comments on commit dfda8c6

Please sign in to comment.