Skip to content

Commit

Permalink
Use integer math instead of round-tripping to float64
Browse files Browse the repository at this point in the history
  • Loading branch information
benhoyt committed Aug 18, 2023
1 parent faf1a9b commit da59527
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internals/overlord/servstate/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ func (s *serviceData) startInternal() error {
// to reuse it in this context. Use a value slightly less than the kill
// delay (90% of it) to avoid racing with trying to send SIGKILL (to a
// process that has already exited).
s.cmd.WaitDelay = time.Duration(s.killDelay().Seconds() * 0.9 * float64(time.Second))
s.cmd.WaitDelay = s.killDelay() * 9 / 10 // will only overflow if kill-delay is 32 years!

// Start the process!
logger.Noticef("Service %q starting: %s", serviceName, s.config.Command)
Expand Down

0 comments on commit da59527

Please sign in to comment.