Skip to content

onReady might be executed twice #5049

@mcollina

Description

@mcollina

If we call ready() in parallel, the onReady hooks are triggered twice

import fastify from './fastify.js'

const app = fastify()

app.addHook('onReady', async function () {
  console.log('onReady')
})


await Promise.race([app.ready(), app.ready()])

await app.ready()

Note that this is also a problem when using inject()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions