Skip to content

Commit

Permalink
fix: made the worker terminate gracefully.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdutz committed Dec 16, 2021
1 parent e1c73a7 commit 6154562
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plc4go/internal/plc4go/spi/default/DefaultCodec.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,12 @@ func (m *defaultCodec) Work(codec *DefaultCodecRequirements) {
// TODO: If this is an error, cast it to an error and log it with "Err(err)"
log.Error().Msgf("recovered from: %#v at %s", err, string(debug.Stack()))
}
workerLog.Warn().Msg("Keep running")
m.Work(codec)
if m.running {
workerLog.Warn().Msg("Keep running")
m.Work(codec)
} else {
workerLog.Info().Msg("Worker terminated")
}
}(workerLog)

// Start an endless loop
Expand Down

0 comments on commit 6154562

Please sign in to comment.