Skip to content

Commit

Permalink
always build www
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino committed Sep 24, 2024
1 parent 0e64f2a commit 8c58683
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/www.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ on:
branches:
- master
- "renovate/frontend/*"
paths:
- ".github/workflows/www.yaml"
- "www/**"
pull_request:
branches:
- "**"
paths:
- ".github/workflows/www.yaml"
- "www/**"
jobs:
build:
name: Build image
Expand Down
2 changes: 2 additions & 0 deletions apps/core/lib/core/retry.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
defmodule Core.Retry do
require Logger

defstruct [wait: 200, attempts: 0, max: 3]

def retry(fun, args) when is_function(fun) and (is_list(args) or is_map(args)) do
Expand Down
9 changes: 8 additions & 1 deletion apps/core/lib/core/services/cloud/workflow/shared.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,20 @@ defmodule Core.Services.Cloud.Workflow.Shared do
def sync(_), do: :ok

def up(%ConsoleInstance{status: :deployment_created, url: url} = inst) do
:timer.sleep(:timer.seconds(10))
Core.Retry.retry(fn ->
case {DNS.resolve(url), DNS.resolve(url, :cname)} do
{{:ok, [_ | _]}, _} -> mark_provisioned(inst)
{_, {:ok, [_ | _]}} -> mark_provisioned(inst)
{{:error, err}, _} -> {:error, "cannot resolve #{url}: #{inspect(err)}"}
end
end, wait: :timer.seconds(30), max: 100)
end, wait: :timer.seconds(30), max: 4)
|> case do
{:ok, _} = res -> res
{:error, err} ->
Logger.info "failed to resolve dns, error: #{inspect(err)}, just going to mark anyways and assume it's a negative caching bug"
mark_provisioned(inst)
end
end

def up(%ConsoleInstance{status: :pending, postgres: pg, configuration: conf} = inst) do
Expand Down

0 comments on commit 8c58683

Please sign in to comment.