mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-13 01:08:45 -05:00
block with a range instead of a select without default
This commit is contained in:
@@ -171,10 +171,11 @@ func trap(logger log.Logger, runtime *gorun.Runtime) {
|
||||
|
||||
logger.Info().Msgf("Service runtime started")
|
||||
|
||||
select {
|
||||
case <-shutdown:
|
||||
// block until there is a value
|
||||
for range shutdown {
|
||||
logger.Info().Msg("shutdown signal received")
|
||||
logger.Info().Msg("stopping service runtime")
|
||||
close(shutdown)
|
||||
}
|
||||
|
||||
if err := (*runtime).Stop(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user