From eb03cb585746b61c1617a962943bcc45c5167182 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 5 Mar 2026 02:14:24 +0000 Subject: [PATCH] Initialize stadia maps client on startup --- main.go | 2 ++ platform/geocode/geocode.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/main.go b/main.go index 0c9a132b..2f3b197d 100644 --- a/main.go +++ b/main.go @@ -18,6 +18,7 @@ import ( "github.com/Gleipnir-Technology/nidus-sync/html" "github.com/Gleipnir-Technology/nidus-sync/llm" "github.com/Gleipnir-Technology/nidus-sync/platform/email" + "github.com/Gleipnir-Technology/nidus-sync/platform/geocode" "github.com/Gleipnir-Technology/nidus-sync/platform/text" "github.com/Gleipnir-Technology/nidus-sync/rmo" nidussync "github.com/Gleipnir-Technology/nidus-sync/sync" @@ -111,6 +112,7 @@ func main() { os.Exit(7) } + geocode.InitializeStadia(config.StadiaMapsAPIKey) router_logger := log.With().Logger() sentryMiddleware := sentryhttp.New(sentryhttp.Options{ Repanic: true, diff --git a/platform/geocode/geocode.go b/platform/geocode/geocode.go index 714d8512..2311c55d 100644 --- a/platform/geocode/geocode.go +++ b/platform/geocode/geocode.go @@ -41,6 +41,10 @@ func (a Address) String() string { var client *stadia.StadiaMaps +func InitializeStadia(key string) { + client = stadia.NewStadiaMaps(key) +} + // Either get an address that matches, or create a new address. Either way, return an address // This will make a call to a structured geocode service, so it's slow. func EnsureAddress(ctx context.Context, txn bob.Tx, org *models.Organization, a Address) (*models.Address, error) {