Migrate close(long, TimeUnit) to close(Duration)

Proprietary

Kafka 3.0 removed close(long, TimeUnit) from the consumer, producer and admin clients in favor of close(Duration). A TimeUnit constant becomes the matching Duration factory, such as Duration.ofSeconds(..); any other unit becomes Duration.ofMillis(unit.toMillis(timeout)), as the removed methods did.

io.moderne.kafka.MigrateClientCloseToDuration
mod run . --recipe=io.moderne.kafka.MigrateClientCloseToDuration

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.