File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { execSync } from 'node:child_process' ;
2
2
import { replaceDbWithBackup } from './replaceDbWithBackup.mjs' ;
3
3
4
+ // Turn on swap to avoid out-of-memory errors during `prisma migrate deploy`
5
+ console . log ( execSync ( 'fallocate -l 256M /swapfile' , { encoding : 'utf-8' } ) ) ;
6
+ console . log ( execSync ( 'chmod 0600 /swapfile' , { encoding : 'utf-8' } ) ) ;
7
+ console . log ( execSync ( 'mkswap /swapfile' , { encoding : 'utf-8' } ) ) ;
8
+ console . log ( execSync ( 'echo 10 > /proc/sys/vm/swappiness' , { encoding : 'utf-8' } ) ) ;
9
+ console . log ( execSync ( 'swapon /swapfile' , { encoding : 'utf-8' } ) ) ;
10
+
4
11
if ( process . env . FLY_APP_NAME === 'vlach-cookbook-staging' ) {
5
12
// Copy the latest backup over the staging database before running the Prisma
6
13
// migration, to make sure the migration will work when the app is released.
You can’t perform that action at this time.
0 commit comments