Skip to content

Commit

Permalink
enable wal
Browse files Browse the repository at this point in the history
  • Loading branch information
AvidDabbler committed Feb 4, 2024
1 parent cc3d7f2 commit f690af7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN tar -C /usr/local/bin -xzf /tmp/litestream.tar.gz

# Install openssl for Prisma
RUN apt-get update && apt-get install -y openssl sqlite3

# Install all node_modules, including dev dependencies
FROM base as deps

Expand Down
5 changes: 5 additions & 0 deletions drizzle/enable-wal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { sql } from "drizzle-orm";

import { db } from "./config";

db.run(sql`PRAGMA journal_mode = WAL;`);
6 changes: 5 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@
# echo 1 >/proc/sys/vm/overcommit_memory

# npx prisma migrate deploy
exec litestream replicate -exec "npm run start"
## Enables WAL Mode
node ./drizzle/enable-wal.js

npx concurrently "litestream replicate -config /etc/litestream.yml" "npm run start"
# exec litestream replicate -exec "npm run start"

0 comments on commit f690af7

Please sign in to comment.