Skip to content

Commit

Permalink
Track first run
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Jul 3, 2020
1 parent 28e7691 commit 8987299
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/gatsby/src/commands/develop-process.ts
Expand Up @@ -191,9 +191,10 @@ module.exports = async (program: IProgram): Promise<void> => {
parentSpan,
gatsbyNodeGraphQLFunction,
graphqlRunner,
firstRun,
}: IBuildContext): IQueryRunningContext => {
return {
firstRun: true,
firstRun,
program,
store,
parentSpan,
Expand Down Expand Up @@ -228,6 +229,9 @@ module.exports = async (program: IProgram): Promise<void> => {

await startWebpackServer({ program, app, workerPool })
},
onDone: {
actions: assign<IBuildContext, any>({ firstRun: false }),
},
},
},
},
Expand All @@ -254,7 +258,7 @@ module.exports = async (program: IProgram): Promise<void> => {
(_, { data }): DataLayerResult => data
),
},
}).withContext({ program, parentSpan: bootstrapSpan, app })
}).withContext({ program, parentSpan: bootstrapSpan, app, firstRun: true })
)

const isInterpreter = <T>(
Expand Down
1 change: 1 addition & 0 deletions packages/gatsby/src/services/types.ts
Expand Up @@ -16,6 +16,7 @@ export interface IMutationAction {
payload: unknown[]
}
export interface IBuildContext {
firstRun?: boolean
program?: IProgram
store?: Store<IGatsbyState, AnyAction>
parentSpan?: Span
Expand Down

0 comments on commit 8987299

Please sign in to comment.