Make inserting data into search table an async operation

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-10-23 16:33:56 +02:00
parent 7b6d9f73d3
commit b117985dff
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -247,7 +247,7 @@ defmodule Mobilizon.Events do
role: :creator,
event_id: event.id
}) do
Search.insert_search_event(event)
Task.start(fn -> Search.insert_search_event(event) end)
{:ok, event}
else
# We don't create a creator participant if the event is a draft
@ -299,7 +299,7 @@ defmodule Mobilizon.Events do
changes
)
Search.update_search_event(new_event)
Task.start(fn -> Search.update_search_event(new_event) end)
{:ok, new_event}
end