Skip to content

Commit b84c509

Browse files
authored
feat: add an optional config model for database retries (#477)
* feat: add an optional config model for database retries * style: tweak naming * fix: make it a pointer
1 parent f5adafe commit b84c509

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

database/model_config.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type DatabaseConfig struct {
1515
Spanner *SpannerConfig
1616
Postgres *PostgresConfig
1717
DatabaseName string
18+
Retries *RetryConfig
1819
}
1920

2021
type SpannerConfig struct {
@@ -96,3 +97,9 @@ type ConnectionsConfig struct {
9697
MaxLifetime time.Duration
9798
MaxIdleTime time.Duration
9899
}
100+
101+
type RetryConfig struct {
102+
MaxAttempts int
103+
MinDuration time.Duration
104+
MaxDuration time.Duration
105+
}

0 commit comments

Comments
 (0)