mirror of
https://github.com/mentos1386/zdravko.git
synced 2024-11-22 15:53:45 +00:00
18 lines
434 B
Go
18 lines
434 B
Go
package internal
|
|
|
|
import (
|
|
"time"
|
|
|
|
"code.tjo.space/mentos1386/zdravko/internal/config"
|
|
"code.tjo.space/mentos1386/zdravko/pkg/retry"
|
|
"go.temporal.io/sdk/client"
|
|
)
|
|
|
|
func ConnectToTemporal(cfg *config.Config) (client.Client, error) {
|
|
// Try to connect to the Temporal Server
|
|
return retry.Retry(5, 6*time.Second, func() (client.Client, error) {
|
|
return client.Dial(client.Options{
|
|
HostPort: cfg.Temporal.ServerHost,
|
|
})
|
|
})
|
|
}
|