File tree 2 files changed +12
-3
lines changed
packages/gatsby/src/utils
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,10 @@ const cacheDbFile =
13
13
} `
14
14
: `caches-lmdb`
15
15
16
- const dbPath = path . join ( process . cwd ( ) , `.cache/${ cacheDbFile } ` )
16
+ const dbPath = path . join (
17
+ global . __GATSBY ?. root || process . cwd ( ) ,
18
+ `.cache/${ cacheDbFile } `
19
+ )
17
20
18
21
function getAlreadyOpenedStore ( ) : RootDatabase | undefined {
19
22
if ( ! globalThis . __GATSBY_OPEN_ROOT_LMDBS ) {
Original file line number Diff line number Diff line change @@ -23,7 +23,13 @@ function setupFsWrapper(): string {
23
23
} catch ( e ) {
24
24
// we are in a read-only filesystem, so we need to use a temp dir
25
25
26
- const TEMP_CACHE_DIR = path . join ( tmpdir ( ) , `gatsby` , `.cache` )
26
+ const TEMP_DIR = path . join ( tmpdir ( ) , `gatsby` )
27
+ const TEMP_CACHE_DIR = path . join ( TEMP_DIR , `.cache` )
28
+
29
+ global . __GATSBY = {
30
+ root : TEMP_DIR ,
31
+ buildId : `` ,
32
+ }
27
33
28
34
// TODO: don't hardcode this
29
35
const cacheDir = `/var/task/.cache`
@@ -148,8 +154,8 @@ async function getEngine(): Promise<GraphQLEngineType> {
148
154
reject ( error )
149
155
} )
150
156
} )
157
+ console . log ( `Downloaded datastore from CDN` )
151
158
}
152
- console . log ( `Downloaded datastore from CDN` )
153
159
154
160
const graphqlEngine = new GraphQLEngine ( {
155
161
dbPath,
You can’t perform that action at this time.
0 commit comments