logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

instances_controller.ex (630B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.PleromaAPI.InstancesController do
  5. use Pleroma.Web, :controller
  6. alias Pleroma.Instances
  7. plug(Pleroma.Web.ApiSpec.CastAndValidate)
  8. defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaInstancesOperation
  9. def show(conn, _params) do
  10. unreachable =
  11. Instances.get_consistently_unreachable()
  12. |> Map.new(fn {host, date} -> {host, to_string(date)} end)
  13. json(conn, %{"unreachable" => unreachable})
  14. end
  15. end