Non-runnables are being setup automatically.

In practice, they’re being setup after their last token provider has
been started.
master
Luka Vandervelden 2019-11-11 20:52:15 +01:00
parent ef7521c5b6
commit 1a90b285d2
1 changed files with 25 additions and 0 deletions

View File

@ -373,6 +373,31 @@ class Service
now = Time.local now = Time.local
end end
end end
provides.each do |token_definition|
reverse_dependencies = get_consumers(token_definition.token)
.map(&.id)
.compact_map do |id|
context.get_service_by_id id
end
reverse_dependencies.each do |service|
next unless service.non_runnable
should_start = service
.dependency_tree.flatten
.select(&.!=(self))
.map(&.status(context))
.map do |status|
status.running? || status.non_runnable?
end
.reduce do |a, b| a && b end
if should_start
service.start context
end
end
end
end end
# TODO: # TODO: