From b117985dffc09dd17d19d94e61ff46ef7faef1dc Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 23 Oct 2019 16:33:56 +0200 Subject: [PATCH] Make inserting data into search table an async operation Signed-off-by: Thomas Citharel --- lib/mobilizon/events/events.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mobilizon/events/events.ex b/lib/mobilizon/events/events.ex index 3737f229f..5e70cc414 100644 --- a/lib/mobilizon/events/events.ex +++ b/lib/mobilizon/events/events.ex @@ -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