Skip to content

Commit

Permalink
improvement: various configuration fixes and flame fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Dec 7, 2023
1 parent ff0ee38 commit 5c40226
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if config_env() == :prod do

config :flame, :backend, FLAME.FlyBackend
config :flame, FLAME.FlyBackend, token: System.fetch_env!("FLY_API_TOKEN")
config :flame, :terminator, shutdown_timeout: :timer.seconds(120)
config :flame, :terminator, shutdown_timeout: :timer.minutes(10)

# The secret key base is used to sign/encrypt cookies and other secrets.
# A default value is used in config/dev.exs and config/test.exs but you
Expand Down
6 changes: 3 additions & 3 deletions lib/ash_hq/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule AshHq.Application do
!flame_parent && Supervisor.child_spec({Finch, name: Swoosh.Finch}, id: Swoosh.Finch),
AshHq.Vault,
# Start the Ecto repository
!flame_parent && AshHq.Repo,
AshHq.Repo,
AshHq.SqliteRepo,
# Start the Telemetry supervisor
AshHqWeb.Telemetry,
Expand All @@ -34,8 +34,8 @@ defmodule AshHq.Application do
# Start the Endpoint (http/https)
!flame_parent && AshHqWeb.Endpoint,
{AshHq.Docs.Library.Agent, nil},
{Cluster.Supervisor, [topologies, [name: AshHq.ClusterSupervisor]]},
!flame_parent && {Haystack.Storage.ETS, storage: AshHq.Docs.Indexer.storage()},
# !flame_parent && {Cluster.Supervisor, [topologies, [name: AshHq.ClusterSupervisor]]},
{Haystack.Storage.ETS, storage: AshHq.Docs.Indexer.storage()},
!flame_parent && AshHq.Docs.Indexer,
!flame_parent && AshHq.Github.Monitor,
!flame_parent && oban_worker(),
Expand Down
10 changes: 7 additions & 3 deletions lib/ash_hq/docs/resources/library/library.ex
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ defmodule AshHq.Docs.Library do

change fn changeset, _ ->
Ash.Changeset.around_transaction(changeset, fn changeset, func ->
FLAME.call(AshHq.ImporterPool, fn ->
func.(changeset)
end)
FLAME.call(
AshHq.ImporterPool,
fn ->
func.(changeset)
end,
timeout: :timer.minutes(10)
)
end)
end

Expand Down
9 changes: 5 additions & 4 deletions rel/env.sh.eex
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh

ip=$(grep fly-local-6pn /etc/hosts | cut -f 1)
export RELEASE_DISTRIBUTION=name
export RELEASE_NODE=$FLY_APP_NAME@$ip
export ELIXIR_ERL_OPTIONS="-proto_dist inet6_tcp"
export ERL_AFLAGS="-proto_dist inet6_tcp"
export ECTO_IPV6="true"
export DNS_CLUSTER_QUERY="${FLY_APP_NAME}.internal"
export RELEASE_DISTRIBUTION="name"
export RELEASE_NODE="${FLY_APP_NAME}-${FLY_IMAGE_REF##*-}@${FLY_PRIVATE_IP}"

0 comments on commit 5c40226

Please sign in to comment.