tsed: [BUG] $onRoutesInit takes a long time since 6.59.6

Information

  • Version: 6.59.6

Since the upgrade to v6.59.6, the $onRoutesInit hook is taking a long time (like 4 seconds). We are using in our project the $onBeforeRoutesInit and $onAfterRoutesInit hooks but not the $onRoutesInit.

It was working fine with v6.59.5 ($onRoutesInit takes some milliseconds only to execute).

Is there something we are missing? How can we diagnose this issue?

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 29 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Hooo… sorry, I forgot to release the fix ^^’ My bad…

The problem is not related to Ts.ED, it was related to somehow a race condition between Ts.ED and swagger-stats, because we were reading the swagger.json file in the $onReady hook to give the Swagger spec to swagger-stats.

Now we use the directly the SwaggerService service to get the OpenSpec object without relying on the swagger.json file and it works.

If you need a reproducible example, you can find it here: https://github.com/jpc-dnr/tsed-1496

Thanks!