Skip to content

Commit 5ae6c80

Browse files
authored
Fix slow pantry caching by using memory as much as possible (#78)
1 parent 572154c commit 5ae6c80

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/hooks/useSyncCache.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ export default async function() {
1616
// unique or don’t insert what is already there or just dump tables first perhaps
1717

1818
try {
19+
// speeds up by using memory as much as possible
20+
db.exec(`
21+
PRAGMA synchronous = OFF;
22+
PRAGMA journal_mode = MEMORY;
23+
PRAGMA temp_store = MEMORY;
24+
`);
25+
1926
await db.transaction(async () => {
2027
db.exec(`
2128
DROP TABLE IF EXISTS provides;

src/utils/semver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//HEY YOU! DO NOT CHANGE THIS TO USE deps.ts since it breaks pkgx/gui and scripts ’n’ shit
2-
import { isArray, isString } from "https://deno.land/x/is_what@v4.1.16/src/index.ts"
2+
import { isArray, isString } from "https://deno.land/x/is_what@v4.1.15/src/index.ts"
33

44
/**
55
* we have our own implementation because open source is full of weird

0 commit comments

Comments
 (0)