From ab2ab99b1742c9aa76d0dbbd6628b245a61056dc Mon Sep 17 00:00:00 2001 From: Darwin D Wu Date: Sun, 26 Nov 2023 23:22:29 -0800 Subject: [PATCH] clear out unnecessary modules --- lib/inngest/function.ex | 10 ++++++---- lib/inngest/function/step.ex | 35 +++++++++-------------------------- 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/lib/inngest/function.ex b/lib/inngest/function.ex index 90aac89c..bd8fd80a 100644 --- a/lib/inngest/function.ex +++ b/lib/inngest/function.ex @@ -133,10 +133,11 @@ defmodule Inngest.Function do step: %Step{ id: :step, name: "step", - runtime: %Step.RunTime{ + runtime: %{ + type: "http", url: "#{Config.app_host() <> path}?fnId=#{id}&step=step" }, - retries: %Step.Retry{ + retries: %{ attempts: 0 } } @@ -156,10 +157,11 @@ defmodule Inngest.Function do step: %Step{ id: :step, name: "step", - runtime: %Step.RunTime{ + runtime: %{ + type: "http", url: "#{Config.app_host() <> path}?fnId=#{slug()}&step=step" }, - retries: %Step.Retry{ + retries: %{ attempts: retries() } } diff --git a/lib/inngest/function/step.ex b/lib/inngest/function/step.ex index afc34167..4aad5b53 100644 --- a/lib/inngest/function/step.ex +++ b/lib/inngest/function/step.ex @@ -18,33 +18,16 @@ defmodule Inngest.Function.Step do name: binary(), opts: map(), mod: module(), - runtime: RunTime, - retries: Retry + runtime: runtime(), + retries: retry() } - defmodule RunTime do - @moduledoc false - - @derive Jason.Encoder - defstruct [ - :url, - type: "http" - ] - - @type t() :: %__MODULE__{ - type: binary(), - url: binary() - } - end - - defmodule Retry do - @moduledoc false - - @derive Jason.Encoder - defstruct attempts: 3 + @type runtime() :: %{ + url: binary(), + type: binary() + } - @type t() :: %__MODULE__{ - attempts: number() - } - end + @type retry() :: %{ + attempts: number() + } end