Background

Workers load BIN fee defaults from the database into an in-memory cache on startup. When you update BIN fees in the database (via admin UI or direct SQL), the running workers still use the old cached values until they are restarted — or until you trigger a reload.

How to Reload

There are three ways to trigger a reload, from simplest to most manual.

1. Admin UI Endpoint

Send an authenticated POST request to the admin service:

POST /reload-bin-fees

This requires admin session authentication (Google OAuth). The response includes the count of BIN fee entries that were reloaded:

Reloaded 8 BIN fee entries

2. Temporal UI

Open the Temporal UI, switch to the core namespace, and start a new workflow:

Field Value
Workflow Type ReloadBinFees
Task Queue CARDS_QUEUE
Input {}

The workflow output is the number of cached entries (e.g. [8]).

3. tctl from Server

SSH into the server and run:

docker exec temporal tctl --address temporal:7233 --ns core \
  workflow run \
  --taskqueue CARDS_QUEUE \
  --workflow_type ReloadBinFees \
  --input '{}' \
  --execution_timeout 30

Expected output ends with:

Status: COMPLETED
Output: [8]

What It Does

  1. Queries all rows from the bins table.
  2. Clears the in-memory fee cache (dom.ResetDefaultBinFees()).
  3. Re-registers each BIN's fees into the cache (dom.RegisterDefaultBinFees()).
  4. Returns the count of BINs with non-null fees.

The reload runs as a Temporal activity on the workers process, so it refreshes the cache in the same process that serves card operations.

When to Use

  • After updating BIN fee defaults in the admin UI or via SQL.
  • After adding new BINs to the system.
  • No need to reload after changing per-account fee overrides (account_bins.fees) — those are read from the database on each operation, not cached.