Skip to content

Commit

Permalink
Clean up dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Oct 25, 2024
1 parent f787c19 commit 41ce9ee
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
2 changes: 2 additions & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Config

config :uplink, Uplink.Data, mode: "pro"

config :uplink, Uplink.Monitors, enabled: false

config :uplink, Uplink.Repo,
username:
System.get_env("UPLINK_DB_USERNAME") || System.get_env("POSTGRES_USERNAME"),
Expand Down
13 changes: 12 additions & 1 deletion lib/uplink/monitors.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ defmodule Uplink.Monitors do
}

def start_link(options) do
Task.start_link(__MODULE__, :run, [options])
enabled? = config(:enabled, true)

if enabled? do
Task.start_link(__MODULE__, :run, [options])
else
:ignore
end
end

def run(_options) do
Expand Down Expand Up @@ -59,4 +65,9 @@ defmodule Uplink.Monitors do

Pipelines.start(module)
end

def config(key, default) do
Application.get_env(:uplink, __MODULE__)
|> Keyword.get(key, default)
end
end
1 change: 0 additions & 1 deletion lib/uplink/packages/instance/install.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ defmodule Uplink.Packages.Instance.Install do
use Oban.Worker, queue: :instance, max_attempts: 3

alias Uplink.Repo
alias Uplink.Cache
alias Uplink.Instances

alias Uplink.Clients.LXD
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ defmodule Uplink.MixProject do

# Infrastructure
{:formation, "~> 0.15"},
{:lexdee, path: "../lexdee", override: true},
{:lexdee, "~> 2.4.4"},
{:plug_cowboy, "~> 2.0"},
{:reverse_proxy_plug, "~> 2.1"},
{:mint_web_socket, "~> 1.0.2"},
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"httpoison": {:hex, :httpoison, "2.2.1", "87b7ed6d95db0389f7df02779644171d7319d319178f6680438167d7b69b1f3d", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "51364e6d2f429d80e14fe4b5f8e39719cacd03eb3f9a9286e61e216feac2d2df"},
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
"lexdee": {:hex, :lexdee, "2.4.3", "3049ee1df9ce9478208231bf8e3b1f63c98d2d71d7bfe6491a5b926446cdfe41", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:mint_web_socket, "~> 1.0.2", [hex: :mint_web_socket, repo: "hexpm", optional: false]}, {:tesla, "~> 1.7.0", [hex: :tesla, repo: "hexpm", optional: false]}, {:x509, "~> 0.8.1", [hex: :x509, repo: "hexpm", optional: false]}], "hexpm", "5464fecaaca8cdb773a412738c8bbb288928a21054f8acdbf184515fff628992"},
"lexdee": {:hex, :lexdee, "2.4.4", "1763f4e0ab7a97cadc25622faaf80ae63186f12bf5e36d1f92bd8d820e31fa16", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:mint_web_socket, "~> 1.0.2", [hex: :mint_web_socket, repo: "hexpm", optional: false]}, {:tesla, "~> 1.7.0", [hex: :tesla, repo: "hexpm", optional: false]}, {:x509, "~> 0.8.1", [hex: :x509, repo: "hexpm", optional: false]}], "hexpm", "d460902b4f0a686485850cc4fd1eb7c9325a90bbf43106aac06a3b567bdc5e82"},
"libcluster": {:hex, :libcluster, "3.3.3", "a4f17721a19004cfc4467268e17cff8b1f951befe428975dd4f6f7b84d927fe0", [:mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "7c0a2275a0bb83c07acd17dab3c3bfb4897b145106750eeccc62d302e3bdfee5"},
"libring": {:hex, :libring, "1.6.0", "d5dca4bcb1765f862ab59f175b403e356dec493f565670e0bacc4b35e109ce0d", [:mix], [], "hexpm", "5e91ece396af4bce99953d49ee0b02f698cd38326d93cd068361038167484319"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
Expand Down
2 changes: 1 addition & 1 deletion test/uplink/clients/lxd/instance/manager_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ defmodule Uplink.Clients.LXD.Instance.ManagerTest do
|> Plug.Conn.resp(200, response)
end)

assert [instance1, _instance2] = Manager.list("default")
assert [instance1, _instance2] = Manager.list(project: "default")
assert %Instance{} = instance1
end
end
Expand Down

0 comments on commit 41ce9ee

Please sign in to comment.