mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 05:37:59 +01:00
Spawn off on hides, adjust retries
This commit is contained in:
parent
dd85badae4
commit
51b2c7410c
3 changed files with 11 additions and 4 deletions
|
@ -95,6 +95,9 @@ config :ex_aws, :hackney_opts,
|
|||
use_default_pool: false,
|
||||
pool: false
|
||||
|
||||
config :ex_aws, :retries,
|
||||
max_attempts: 20
|
||||
|
||||
if config_env() != :test do
|
||||
# Database config
|
||||
config :philomena, Philomena.Repo,
|
||||
|
|
|
@ -535,14 +535,16 @@ defmodule Philomena.Images do
|
|||
defp process_after_hide(result) do
|
||||
case result do
|
||||
{:ok, %{image: image, tags: tags, reports: {_count, reports}} = result} ->
|
||||
Thumbnailer.hide_thumbnails(image, image.hidden_image_key)
|
||||
spawn(fn ->
|
||||
Thumbnailer.hide_thumbnails(image, image.hidden_image_key)
|
||||
purge_files(image, image.hidden_image_key)
|
||||
end)
|
||||
|
||||
Comments.reindex_comments(image)
|
||||
Reports.reindex_reports(reports)
|
||||
Tags.reindex_tags(tags)
|
||||
reindex_image(image)
|
||||
reindex_copied_tags(result)
|
||||
purge_files(image, image.hidden_image_key)
|
||||
|
||||
{:ok, result}
|
||||
|
||||
|
@ -586,7 +588,9 @@ defmodule Philomena.Images do
|
|||
|> Repo.transaction()
|
||||
|> case do
|
||||
{:ok, %{image: image, tags: tags}} ->
|
||||
Thumbnailer.unhide_thumbnails(image, key)
|
||||
spawn(fn ->
|
||||
Thumbnailer.unhide_thumbnails(image, key)
|
||||
end)
|
||||
|
||||
reindex_image(image)
|
||||
purge_files(image, image.hidden_image_key)
|
||||
|
|
|
@ -47,7 +47,7 @@ defmodule Philomena.Objects do
|
|||
run_all(fn opts ->
|
||||
file_path
|
||||
|> ExAws.S3.Upload.stream_file()
|
||||
|> ExAws.S3.upload(opts[:bucket], key, content_type: mime)
|
||||
|> ExAws.S3.upload(opts[:bucket], key, content_type: mime, max_concurrency: 2)
|
||||
|> ExAws.request!(opts[:config_overrides])
|
||||
end)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue