How to run code after http server startup?

I make an API call to register my webhook with some third party service on startup.

But that service doesn’t let me make that registration until it checks for itself that the url i gave it exists.

But it seems that during on_startup, the server is not yet ready to serve requests, and I did not find anything named after_startup.

It seems over complicated (the intent of the code is greatly obscured), and I am unsure whether or not it is racy, but I have a workaround which seems to function for now:

i put the webhook registration code into a “task”, as per the “Background tasks” part of the documentation.