I refactored the code slightly, e.g. make it more clear for what block a lock
is active (it was misleading before due to Futures). The code should probably
be converted into an actor or something similar because the synchronization
is probably not sufficient as it is.
I also made the code perform slightly better during reconciliation
if no health checks need to be added.
I also noticed that the health check requires that all app versions for which tasks
are still active are kept in the AppRepository. Our current maxVersions policy does
not ensure that. I made an appropriate FIXME for that.
This patch also improves the logging of health checks by including app versioning information.
This conveys better that the HealthCheckActor is actually instantiated per app version.