Skip to content

Commit

Permalink
Rollback DANGEROUSLY_DISABLE_OOM (#14767)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhijithvijayan authored and wardpeet committed Jun 13, 2019
1 parent 672e384 commit cad6861
Showing 3 changed files with 0 additions and 31 deletions.
17 changes: 0 additions & 17 deletions docs/docs/scaling-issues.md
Original file line number Diff line number Diff line change
@@ -57,23 +57,6 @@ It's difficult to pin down exactly _how_ to fix a scaling issue. We have some re

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.

### `DANGEROUSLY_DISABLE_OOM`

Gatsby's caching mechanism persists a (possibly!) large `json` file to disk _in memory._ To opt-out of this, consider something like:

```json
{
"devDependencies": {
"cross-env": "^5.2.0"
},
"scripts": {
"build": "cross-env DANGEROUSLY_DISABLE_OOM=true gatsby build"
}
}
```

This will prevent caching, so it's recommended to only use this alongside the `gatsby build` command.

### `GATSBY_DB_NODES`

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.
10 changes: 0 additions & 10 deletions packages/gatsby/src/redux/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -66,14 +66,4 @@ describe(`redux db`, () => {
// yuck - loki and redux will have different shape of redux state (nodes and nodesByType)
expect(_.omit(data, [`nodes`, `nodesByType`])).toMatchSnapshot()
})

it(`does not write to the cache when DANGEROUSLY_DISABLE_OOM is set`, async () => {
process.env.DANGEROUSLY_DISABLE_OOM = true

await saveState()

expect(writeToCache).not.toBeCalled()

delete process.env.DANGEROUSLY_DISABLE_OOM
})
})
4 changes: 0 additions & 4 deletions packages/gatsby/src/redux/index.js
Original file line number Diff line number Diff line change
@@ -52,10 +52,6 @@ const store = configureStore(readState())

// Persist state.
const saveState = () => {
if (process.env.DANGEROUSLY_DISABLE_OOM) {
return Promise.resolve()
}

const state = store.getState()
const pickedState = _.pick(state, [
`nodes`,

0 comments on commit cad6861

Please sign in to comment.