Skip to content

Commit

Permalink
Fix warning about Application.get_env/3 discouraged in the module body
Browse files Browse the repository at this point in the history
  • Loading branch information
Роман Смирнов committed Mar 22, 2024
1 parent 9810163 commit 475e1d1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/kaffe/consumer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ defmodule Kaffe.Consumer do

@behaviour :brod_group_subscriber

@kafka Application.get_env(:kaffe, :kafka_mod, :brod)
@group_subscriber Application.get_env(:kaffe, :group_subscriber_mod, :brod_group_subscriber)
@kafka Application.compile_env(:kaffe, :kafka_mod, :brod)
@group_subscriber Application.compile_env(:kaffe, :group_subscriber_mod, :brod_group_subscriber)

require Record
import Record, only: [defrecord: 2, extract: 2]
Expand Down
2 changes: 1 addition & 1 deletion lib/kaffe/producer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule Kaffe.Producer do
Currently only synchronous production is supported.
"""

@kafka Application.get_env(:kaffe, :kafka_mod, :brod)
@kafka Application.compile_env(:kaffe, :kafka_mod, :brod)

@typedoc """
A Kafka message can be represented as a tuple containing a key value pair of type binary()
Expand Down
2 changes: 1 addition & 1 deletion test/support/test_brod.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule TestBrod do
use GenServer

@test_partition_count Application.get_env(:kaffe, :test_partition_count)
@test_partition_count Application.compile_env(:kaffe, :test_partition_count)

require Logger

Expand Down

0 comments on commit 475e1d1

Please sign in to comment.