Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reg onPostStop is not executing statements inside method #4438

Open
vinaykumar612 opened this issue Mar 21, 2023 · 1 comment
Open

Reg onPostStop is not executing statements inside method #4438

vinaykumar612 opened this issue Mar 21, 2023 · 1 comment
Labels
support Questions, discussions, and general support

Comments

@vinaykumar612
Copy link

Support plan

  • is this issue currently blocking your project? (yes/no):no
  • is this issue affecting a production system? (yes/no):no

Context

  • node 17.9.1:
  • @hapi/hapi 20.2.1:
  • node (e.g. node, browser, native):
  • hapi (e.g. hapi application, another framework, standalone, ...):
  • any other relevant information:

How can we help?

server.ext({
      type: 'onPostStop',
      method (request, reply) {
        console.log('Application stopped');
      },
});
@vinaykumar612 vinaykumar612 added the support Questions, discussions, and general support label Mar 21, 2023
@devinivy
Copy link
Member

Sorry, we'll need a lot more information here in order to help you! One thing that stands out in that example is that onPostStop is a server lifecycle extension, so it is not passed request as an argument. In order to trigger this extension point you need to call server.stop().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Questions, discussions, and general support
Projects
None yet
Development

No branches or pull requests

2 participants