From 01ff551516c8f810827c483fe977b8748d82947d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tao=20Bojl=C3=A9n?= <66130243+taobojlen@users.noreply.github.com> Date: Sat, 10 Jun 2023 14:18:02 +0100 Subject: [PATCH] update appsignal --- backend/config/releases.exs | 2 + backend/config/test.exs | 2 + backend/mix.exs | 2 +- backend/mix.lock | 2 +- frontend/src/redux/actions.ts | 88 +++++++++++++++++------------------ 5 files changed, 48 insertions(+), 48 deletions(-) diff --git a/backend/config/releases.exs b/backend/config/releases.exs index bd80c1e..98999d8 100644 --- a/backend/config/releases.exs +++ b/backend/config/releases.exs @@ -19,6 +19,8 @@ config :backend, Backend.Elasticsearch.Cluster, config :appsignal, :config, otp_app: :backend, + name: "fediverse.space", + active: true, revision: System.get_env("GIT_REV") port = String.to_integer(System.get_env("PORT") || "4000") diff --git a/backend/config/test.exs b/backend/config/test.exs index 221df5a..d533a8f 100644 --- a/backend/config/test.exs +++ b/backend/config/test.exs @@ -16,3 +16,5 @@ config :backend, Backend.Repo, database: "backend_test", hostname: "localhost", pool: Ecto.Adapters.SQL.Sandbox + +config :appsignal, :config, active: false diff --git a/backend/mix.exs b/backend/mix.exs index 1ba757e..cc02d54 100644 --- a/backend/mix.exs +++ b/backend/mix.exs @@ -23,7 +23,6 @@ defmodule Backend.MixProject do :logger, :runtime_tools, :gollum, - :elasticsearch, :appsignal, :swoosh, :gen_smtp @@ -65,6 +64,7 @@ defmodule Backend.MixProject do {:swoosh, "~> 1.0"}, {:gen_smtp, "~> 1.2"}, {:elasticsearch, "~> 1.0"}, + {:appsignal, "~> 2.7"}, {:appsignal_phoenix, "~> 2.3"}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:nebulex, "~> 2.4.2"}, diff --git a/backend/mix.lock b/backend/mix.lock index b8805b9..02b8ea6 100644 --- a/backend/mix.lock +++ b/backend/mix.lock @@ -1,5 +1,5 @@ %{ - "appsignal": {:hex, :appsignal, "2.6.1", "33884b16f70a6a5c5ca9b0451ede414b08486d4feaf51fbd744ff276c147a344", [:make, :mix], [{:decorator, "~> 1.2.3 or ~> 1.3", [hex: :decorator, repo: "hexpm", optional: false]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:poison, ">= 1.3.0", [hex: :poison, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "594efe860ab3b0eb0424466f0d7b267951e14c4b1c03a766df5cec82033760a2"}, + "appsignal": {:hex, :appsignal, "2.7.3", "5cd234052e49014c1590458627eebb68b9250ef13653734a0cf607736e05233b", [:make, :mix], [{:decorator, "~> 1.2.3 or ~> 1.3", [hex: :decorator, repo: "hexpm", optional: false]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:poison, ">= 1.3.0", [hex: :poison, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c24b96512ae7892b075d06d7294aadf89fb18b6e419ace6f3816783831e30d35"}, "appsignal_phoenix": {:hex, :appsignal_phoenix, "2.3.2", "80b2405fa8c4b8c27401b3dda32f90d380fb3f63d67efd6162d9489b8e409b06", [:mix], [{:appsignal, ">= 2.5.1 and < 3.0.0", [hex: :appsignal, repo: "hexpm", optional: false]}, {:appsignal_plug, ">= 2.0.13 and < 3.0.0", [hex: :appsignal_plug, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.11 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_live_view, "~> 0.9", [hex: :phoenix_live_view, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "8543c90688e309a503d7c3425558bf8182730b3efab546d84ec2f5c78eeaebfe"}, "appsignal_plug": {:hex, :appsignal_plug, "2.0.13", "daea31daec103248532c2facbe01098f53914ddecba47263a66574f3b322ac57", [:mix], [{:appsignal, ">= 2.5.1 and < 3.0.0", [hex: :appsignal, repo: "hexpm", optional: false]}, {:plug, ">= 1.1.0", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "704417abf28391ab3f6783ecf75b10242bf240554ddd8819d80b18b131cc2076"}, "bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"}, diff --git a/frontend/src/redux/actions.ts b/frontend/src/redux/actions.ts index a81d599..0391e79 100644 --- a/frontend/src/redux/actions.ts +++ b/frontend/src/redux/actions.ts @@ -85,38 +85,36 @@ export const loadInstance = (instanceName: string | null) => (dispatch: Dispatch .catch(() => dispatch(instanceLoadFailed())); }; -export const updateSearch = (query: string, filters: SearchFilter[]) => ( - dispatch: Dispatch, - getState: () => AppState -) => { - query = query.trim(); +export const updateSearch = + (query: string, filters: SearchFilter[]) => (dispatch: Dispatch, getState: () => AppState) => { + query = query.trim(); - if (!query) { - dispatch(resetSearch()); - return; - } + if (!query) { + dispatch(resetSearch()); + return; + } - const prevQuery = getState().search.query; - const prevFilters = getState().search.filters; - const isNewQuery = prevQuery !== query || !isEqual(prevFilters, filters); + const prevQuery = getState().search.query; + const prevFilters = getState().search.filters; + const isNewQuery = prevQuery !== query || !isEqual(prevFilters, filters); - const { next } = getState().search; - let url = `search/?query=${query}`; - if (!isNewQuery && next) { - url += `&after=${next}`; - } + const { next } = getState().search; + let url = `search/?query=${query}`; + if (!isNewQuery && next) { + url += `&after=${next}`; + } - // Add filters - // The format is e.g. type_eq=mastodon or user_count_gt=1000 - filters.forEach((filter) => { - url += `&${filter.field}_${filter.relation}=${filter.value}`; - }); + // Add filters + // The format is e.g. type_eq=mastodon or user_count_gt=1000 + filters.forEach((filter) => { + url += `&${filter.field}_${filter.relation}=${filter.value}`; + }); - dispatch(requestSearchResult(query, filters)); - return getFromApi(url) - .then((result) => dispatch(receiveSearchResults(result))) - .catch(() => dispatch(searchFailed())); -}; + dispatch(requestSearchResult(query, filters)); + return getFromApi(url) + .then((result) => dispatch(receiveSearchResults(result))) + .catch(() => dispatch(searchFailed())); + }; export const fetchGraph = () => (dispatch: Dispatch) => { dispatch(requestGraph()); @@ -125,22 +123,20 @@ export const fetchGraph = () => (dispatch: Dispatch) => { .catch(() => dispatch(graphLoadFailed())); }; -export const loadInstanceList = (page?: number, sort?: InstanceSort) => ( - dispatch: Dispatch, - getState: () => AppState -) => { - sort = sort || getState().data.instanceListSort; - dispatch(requestInstanceList(sort)); - const params: string[] = []; - if (page) { - params.push(`page=${page}`); - } - if (sort) { - params.push(`sortField=${sort.field}`); - params.push(`sortDirection=${sort.direction}`); - } - const path = params ? `instances?${params.join("&")}` : "instances"; - return getFromApi(path) - .then((instancesListResponse) => dispatch(receiveInstanceList(instancesListResponse))) - .catch(() => dispatch(instanceListLoadFailed())); -}; +export const loadInstanceList = + (page?: number, sort?: InstanceSort) => (dispatch: Dispatch, getState: () => AppState) => { + sort = sort || getState().data.instanceListSort; + dispatch(requestInstanceList(sort)); + const params: string[] = []; + if (page) { + params.push(`page=${page}`); + } + if (sort) { + params.push(`sortField=${sort.field}`); + params.push(`sortDirection=${sort.direction}`); + } + const path = params ? `instances?${params.join("&")}` : "instances"; + return getFromApi(path) + .then((instancesListResponse) => dispatch(receiveInstanceList(instancesListResponse))) + .catch(() => dispatch(instanceListLoadFailed())); + };