File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
packages/gatsby/src/utils Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,10 @@ const cacheDbFile =
1313 } `
1414 : `caches-lmdb`
1515
16- const dbPath = path . join ( process . cwd ( ) , `.cache/${ cacheDbFile } ` )
16+ const dbPath = path . join (
17+ global . __GATSBY ?. root || process . cwd ( ) ,
18+ `.cache/${ cacheDbFile } `
19+ )
1720
1821function getAlreadyOpenedStore ( ) : RootDatabase | undefined {
1922 if ( ! globalThis . __GATSBY_OPEN_ROOT_LMDBS ) {
Original file line number Diff line number Diff line change @@ -23,7 +23,13 @@ function setupFsWrapper(): string {
2323 } catch ( e ) {
2424 // we are in a read-only filesystem, so we need to use a temp dir
2525
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+ }
2733
2834 // TODO: don't hardcode this
2935 const cacheDir = `/var/task/.cache`
@@ -148,8 +154,8 @@ async function getEngine(): Promise<GraphQLEngineType> {
148154 reject ( error )
149155 } )
150156 } )
157+ console . log ( `Downloaded datastore from CDN` )
151158 }
152- console . log ( `Downloaded datastore from CDN` )
153159
154160 const graphqlEngine = new GraphQLEngine ( {
155161 dbPath,
You can’t perform that action at this time.
0 commit comments