Hooks host/managed/update

Looks like host/managed/update is executed way beyond host/managed/after_commit.
For example facts data is missing in case with discovery, also if I’m updating host from host/managed/update event it loops and data doesn’t exist yet in the database (host_parameters_attributes)

If there any way to find work arounds?

I need to generate hostnames checking before with resolv command.

Older foreman versions delete discovered facts during provisioning, there is not flag in settings (disabled by default) to follow that behavior.