feat: enable configured multitable synchronization
This commit is contained in:
@@ -137,14 +137,6 @@ func Load(options LoadOptions) (Config, error) {
|
||||
if environment != "" {
|
||||
cfg.App.Env = environment
|
||||
}
|
||||
if cfg.App.Env == "prod" {
|
||||
if strings.TrimSpace(os.Getenv("APP_DATABASE_PASSWORD")) == "" {
|
||||
return Config{}, errors.New("APP_DATABASE_PASSWORD must be set in production")
|
||||
}
|
||||
if strings.TrimSpace(os.Getenv("APP_AUTH_JWT_SECRET")) == "" {
|
||||
return Config{}, errors.New("APP_AUTH_JWT_SECRET must be set in production")
|
||||
}
|
||||
}
|
||||
if err := cfg.Validate(); err != nil {
|
||||
return Config{}, err
|
||||
}
|
||||
@@ -187,7 +179,7 @@ func (c Config) Validate() error {
|
||||
return errors.New("multitable.base_url must use https when multitable is enabled")
|
||||
}
|
||||
if strings.TrimSpace(c.MultiTable.APIKey) == "" {
|
||||
return errors.New("APP_MULTITABLE_API_KEY is required when multitable is enabled")
|
||||
return errors.New("multitable.api_key is required when multitable is enabled")
|
||||
}
|
||||
if c.MultiTable.SyncInterval <= 0 || c.MultiTable.RequestTimeout <= 0 || c.MultiTable.BatchSize < 1 || c.MultiTable.MaxAttempts < 1 {
|
||||
return errors.New("multitable retry and timeout settings must be positive")
|
||||
|
||||
Reference in New Issue
Block a user