Skip to content

Commit

Permalink
Add different batch size for local dev
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvanleeuwen committed Mar 13, 2024
1 parent fb273ad commit 8b7953f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion server/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ config :mave_metrics,
ecto_repos: [MaveMetrics.Repo],
api_auth: System.get_env("METRICS_AUTH_ENABLED") == "true" || false,
api_user: System.get_env("METRICS_USER"),
api_password: System.get_env("METRICS_PASSWORD")
api_password: System.get_env("METRICS_PASSWORD"),
batch_size: 2

config :mave_metrics, MaveMetrics.Repo, migration_timestamps: [type: :utc_datetime_usec]

Expand Down
6 changes: 5 additions & 1 deletion server/config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import Config
# manifest is generated by the `mix phx.digest` task,
# which you should run after static files are built and
# before starting your production server.
config :mave_metrics, MaveMetricsWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json"
config :mave_metrics, MaveMetricsWeb.Endpoint,
cache_static_manifest: "priv/static/cache_manifest.json"

config :mave_metrics,
batch_size: 50

# Configures Swoosh API Client
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: MaveMetrics.Finch
Expand Down
2 changes: 1 addition & 1 deletion server/lib/mave_metrics/pipeline.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule MaveMetrics.Pipeline do

alias MaveMetrics.Stats

@max_batch_size 50
@max_batch_size Application.compile_env(:mave_metrics, :batch_size)

# 5 minutes
@max_interval_ms 60_000 * 5
Expand Down

0 comments on commit 8b7953f

Please sign in to comment.