26 lines
593 B
Go
26 lines
593 B
Go
package reliable
|
|
|
|
import "time"
|
|
|
|
func (s DurableSettings) StreamMaxAge() time.Duration {
|
|
if s.Stream.MaxAgeHours <= 0 {
|
|
return 48 * time.Hour
|
|
}
|
|
return time.Duration(s.Stream.MaxAgeHours) * time.Hour
|
|
}
|
|
|
|
func (s DurableSettings) IsProductionValidation() bool {
|
|
return s.Provisioning.Environment == DurableEnvironmentProduction
|
|
}
|
|
|
|
func (s DurableSettings) AllowsAutoProvision() bool {
|
|
switch s.Provisioning.Mode {
|
|
case DurableProvisioningApp:
|
|
return true
|
|
case DurableProvisioningHybrid:
|
|
return s.Provisioning.Environment != DurableEnvironmentProduction
|
|
default:
|
|
return false
|
|
}
|
|
}
|