Skip to content

Commit

Permalink
Fix FeedStream queue processor for unknown messages (#484)
Browse files Browse the repository at this point in the history
* Fix queue by skipping unknown SQS messages

* Update setting queue url if not blank, update readme for connecting to heroku
  • Loading branch information
skanderm authored Jun 4, 2024
1 parent 877ce23 commit d4cdd15
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ The new version (v3) is currently under development, rapidly changing, and has n
For the moment, this app is running in a Heroku instance with `mix phx.server`. To access the console, run:

```
heroku run POOL_SIZE=2 iex -a <app name> -- -S mix
heroku run FEED_STREAM_QUEUE_URL="" REDIS_URL="" POOL_SIZE=2 iex -a <app name> -- -S mix
```

The `POOL_SIZE` config var is necessary due to the current Postgres db having 20 connections. You can read more [about it here](https://hexdocs.pm/phoenix/heroku.html#creating-environment-variables-in-heroku).
Expand Down
4 changes: 3 additions & 1 deletion server/config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ if config_env() == :prod do
host = System.get_env("HOST_URL") || "live.orcasite.com"
port = String.to_integer(System.get_env("PORT") || "4000")

config :orcasite, :feed_stream_queue_url, System.get_env("FEED_STREAM_QUEUE_URL")
if System.get_env("FEED_STREAM_QUEUE_URL", "") != "" do
config :orcasite, :feed_stream_queue_url, System.get_env("FEED_STREAM_QUEUE_URL")
end

config :orcasite, OrcasiteWeb.Endpoint,
url: [host: host, port: 443, scheme: "https"],
Expand Down
3 changes: 3 additions & 0 deletions server/lib/orcasite/radio/feed_stream_queue.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ defmodule Orcasite.Radio.FeedStreamQueue do
{:ok, %{"Records" => records}} -> records
_ -> []
end

_ ->
[]
end
end)
|> Enum.flat_map(fn %{"s3" => %{"object" => %{"key" => object_path}}} ->
Expand Down

0 comments on commit d4cdd15

Please sign in to comment.