Skip to content

Commit

Permalink
No save historical messages in DB (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsansaloni authored Nov 25, 2022
1 parent 2de1377 commit 0b0dbad
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
8 changes: 0 additions & 8 deletions lib/postoffice/workers/http.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ defmodule Postoffice.Workers.Http do
target: target
)

{:ok, _data} =
HistoricalData.create_sent_messages(%{
message_id: message_id,
consumer_id: consumer_id,
payload: historical_payload,
attributes: attributes
})

historical_pubsub_args = %{
"consumer_id" => consumer_id,
"target" => Application.get_env(:postoffice, :pubsub_historical_topic_name),
Expand Down
8 changes: 0 additions & 8 deletions lib/postoffice/workers/pubsub.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ defmodule Postoffice.Workers.Pubsub do
target: target
)

{:ok, _data} =
HistoricalData.create_sent_messages(%{
message_id: message_id,
consumer_id: consumer_id,
payload: historical_payload,
attributes: attributes
})

historical_pubsub_args = %{
"consumer_id" => consumer_id,
"target" => Application.get_env(:postoffice, :pubsub_historical_topic_name),
Expand Down
2 changes: 1 addition & 1 deletion test/postoffice/http_worker_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ defmodule Postoffice.HttpWorkerTest do
end)

perform_job(HttpWorker, args)
assert Kernel.length(HistoricalData.list_sent_messages()) == 1
assert Kernel.length(HistoricalData.list_sent_messages()) == 0

end

Expand Down
2 changes: 1 addition & 1 deletion test/postoffice/pubsub_worker_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ defmodule Postoffice.PubsubWorkerTest do
end)

perform_job(PubsubWorker, args)
assert Kernel.length(HistoricalData.list_sent_messages()) == 1
assert Kernel.length(HistoricalData.list_sent_messages()) == 0
end

test "messages can be sent in bulk" do
Expand Down

0 comments on commit 0b0dbad

Please sign in to comment.