forked from potsda.mn/mobilizon
refactor(activitypub): log instance actor details before it's created
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
da3b074619
commit
6d2f08f3c1
|
@ -48,16 +48,17 @@ defmodule Mobilizon.Service.Workers.RefreshInstances do
|
|||
end
|
||||
|
||||
with instance_metadata <- fetch_instance_metadata(domain),
|
||||
:ok <- Logger.debug("Ready to save instance actor details"),
|
||||
{:ok, %InstanceActor{}} <-
|
||||
Instances.create_instance_actor(%{
|
||||
args <- %{
|
||||
domain: domain,
|
||||
actor_id: actor_id,
|
||||
instance_name: get_in(instance_metadata, ["metadata", "nodeName"]),
|
||||
instance_description: get_in(instance_metadata, ["metadata", "nodeDescription"]),
|
||||
software: get_in(instance_metadata, ["software", "name"]),
|
||||
software_version: get_in(instance_metadata, ["software", "version"])
|
||||
}) do
|
||||
},
|
||||
:ok <- Logger.debug("Ready to save instance actor details #{inspect(args)}"),
|
||||
{:ok, %InstanceActor{}} <-
|
||||
Instances.create_instance_actor(args) do
|
||||
Logger.info("Saved instance actor details for domain #{host}")
|
||||
else
|
||||
err ->
|
||||
|
|
Loading…
Reference in a new issue