Skip to content

Commit cad6861

Browse files
abhijithvijayanwardpeet
authored andcommitted
Rollback DANGEROUSLY_DISABLE_OOM (#14767)
1 parent 672e384 commit cad6861

File tree

3 files changed

+0
-31
lines changed

3 files changed

+0
-31
lines changed

docs/docs/scaling-issues.md

-17
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,6 @@ It's difficult to pin down exactly _how_ to fix a scaling issue. We have some re
5757

5858
Note: the application of these techniques should be considered analogous to a applying a bandage. A bandage solves the underlying issue, but at some indeterminate point in the future the underlying issue may be healed! In much the same way--treat these techniques as temporary and re-visit in the future if underlying scaling issues in Gatsby have since been resolved.
5959

60-
### `DANGEROUSLY_DISABLE_OOM`
61-
62-
Gatsby's caching mechanism persists a (possibly!) large `json` file to disk _in memory._ To opt-out of this, consider something like:
63-
64-
```json
65-
{
66-
"devDependencies": {
67-
"cross-env": "^5.2.0"
68-
},
69-
"scripts": {
70-
"build": "cross-env DANGEROUSLY_DISABLE_OOM=true gatsby build"
71-
}
72-
}
73-
```
74-
75-
This will prevent caching, so it's recommended to only use this alongside the `gatsby build` command.
76-
7760
### `GATSBY_DB_NODES`
7861

7962
In preparation for future versions of Gatsby, we've enabled **experimental** support for a different mechanism for the persistence of nodes: [Loki](https://www.npmjs.com/package/lokijs). It's challenging to assess whether this could lead to unforeseen issues without breaking changes, so we've exposed it behind a flag while we continue to assess the impact to Gatsby applications.

packages/gatsby/src/redux/__tests__/index.js

-10
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,4 @@ describe(`redux db`, () => {
6666
// yuck - loki and redux will have different shape of redux state (nodes and nodesByType)
6767
expect(_.omit(data, [`nodes`, `nodesByType`])).toMatchSnapshot()
6868
})
69-
70-
it(`does not write to the cache when DANGEROUSLY_DISABLE_OOM is set`, async () => {
71-
process.env.DANGEROUSLY_DISABLE_OOM = true
72-
73-
await saveState()
74-
75-
expect(writeToCache).not.toBeCalled()
76-
77-
delete process.env.DANGEROUSLY_DISABLE_OOM
78-
})
7969
})

packages/gatsby/src/redux/index.js

-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ const store = configureStore(readState())
5252

5353
// Persist state.
5454
const saveState = () => {
55-
if (process.env.DANGEROUSLY_DISABLE_OOM) {
56-
return Promise.resolve()
57-
}
58-
5955
const state = store.getState()
6056
const pickedState = _.pick(state, [
6157
`nodes`,

0 commit comments

Comments
 (0)