Initialize stadia maps client on startup
This commit is contained in:
parent
61d9a21636
commit
eb03cb5857
2 changed files with 6 additions and 0 deletions
2
main.go
2
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,
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue