Add match url

This commit is contained in:
2024-05-03 00:44:55 +02:00
parent dafadcbddd
commit 080b18c6be
3 changed files with 16 additions and 3 deletions
@@ -44,7 +44,7 @@ defmodule Scrapper.Processor.MatchProcessor do
def process_resp({:ok, raw_match}, match_id) do
decoded_match = Poison.decode!(raw_match, as: %Scrapper.Api.Model.MatchResponse{})
Scrapper.Storage.S3MatchStorage.store_match(match_id, raw_match)
match_url = Scrapper.Storage.S3MatchStorage.store_match(match_id, raw_match)
match = LolAnalytics.Match.MatchRepo.get_match(match_id)
case match do
@@ -52,7 +52,10 @@ defmodule Scrapper.Processor.MatchProcessor do
LolAnalytics.Match.MatchRepo.insert_match(match_id)
_ ->
LolAnalytics.Match.MatchRepo.update_match(match, %{:processed => true})
LolAnalytics.Match.MatchRepo.update_match(match, %{
:processed => true,
:match_url => match_url
})
end
decoded_match.metadata.participants