mirror of
https://github.com/immich-app/immich.git
synced 2026-07-14 09:00:59 +00:00
chore: increase cache_size and use memory temp store (#25930)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
7580521a76
commit
92c79a7122
2 changed files with 4 additions and 1 deletions
|
|
@ -228,7 +228,9 @@ class Drift extends $Drift implements IDatabaseRepository {
|
||||||
await customStatement('PRAGMA foreign_keys = ON');
|
await customStatement('PRAGMA foreign_keys = ON');
|
||||||
await customStatement('PRAGMA synchronous = NORMAL');
|
await customStatement('PRAGMA synchronous = NORMAL');
|
||||||
await customStatement('PRAGMA journal_mode = WAL');
|
await customStatement('PRAGMA journal_mode = WAL');
|
||||||
await customStatement('PRAGMA busy_timeout = 30000');
|
await customStatement('PRAGMA busy_timeout = 30000'); // 30s
|
||||||
|
await customStatement('PRAGMA cache_size = -32000'); // 32MB
|
||||||
|
await customStatement('PRAGMA temp_store = MEMORY');
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ class DriftLogger extends $DriftLogger implements IDatabaseRepository {
|
||||||
await customStatement('PRAGMA synchronous = NORMAL');
|
await customStatement('PRAGMA synchronous = NORMAL');
|
||||||
await customStatement('PRAGMA journal_mode = WAL');
|
await customStatement('PRAGMA journal_mode = WAL');
|
||||||
await customStatement('PRAGMA busy_timeout = 500');
|
await customStatement('PRAGMA busy_timeout = 500');
|
||||||
|
await customStatement('PRAGMA temp_store = MEMORY');
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue