mentorenwahl/docker/backend/src/backend/run.cr
Dominic Grimm 0da7f11239
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
Added login page
2022-02-02 15:38:36 +01:00

26 lines
513 B
Crystal

module Backend
extend self
def run : Nil
{% if flag?(:development) %}
Log.warn { "Backend is running in development mode! Do not use this in production!" }
{% end %}
Log.info { "Starting services..." }
channel = Channel(Nil).new(SERVICES.size)
SERVICES.each do |service|
spawn do
service.call
channel.send(nil)
end
end
SERVICES.size.times do
channel.receive
end
Fiber.yield
Log.info { "Backend services started." }
end
end