Some fixes to stop confusion of kill delay value #397
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After reviewing several previous commits, I discovered that the method in which the kill_delay was specified led to some confusion.
In the initial implementation of kill_delay in commit #49, there was a confusing specification that indicated the value specified as an integer would be parsed as time.Duration and multiplied by time.Second. Therefore, specifying kill_delay as
kill_delay = 2
would mean waiting for2 * 1
second, but specifying kill_delay askill_delay = "2s"
would mean waiting for2000000000 * 1
second.In the subsequent commit ff8c2ed, an explanation (# ms) was added to air_example.toml, and a fix was made to multiply by time.Millisecond. Users who refer to air_example.toml can now use this option as expected, but unfortunately, those who execute air init will see a generated config file with
kill_delay = "0s"
.Then, commit #287 was introduced, and it seemed to aim to help users who configure their kill_delay as
"1s"
. As a result, the configurations that refer to air_example.toml no longer work as expected.The main topic of this pull request is to clarify the specification for kill_delay to avoid confusion. This involves fixing air_example.toml and some test values with kill_delay. It is now clarified that kill_delay should be a string such as
"500ms"
.Ideally, the WithArgs method should also be fixed to parse time.Duration, but I still believe this pull request is worthwhile!