fixup conditions
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
7ec2354720
commit
e25ad4f31b
@ -91,6 +91,10 @@ func (c *consulConfig) Init(opts ...options.Option) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *consulConfig) Load(ctx context.Context, opts ...options.Option) error {
|
func (c *consulConfig) Load(ctx context.Context, opts ...options.Option) error {
|
||||||
|
if c.opts.SkipLoad != nil && c.opts.SkipLoad(ctx, c) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
options := config.NewLoadOptions(opts...)
|
options := config.NewLoadOptions(opts...)
|
||||||
|
|
||||||
if err := config.DefaultBeforeLoad(ctx, c); err != nil && !c.opts.AllowFail {
|
if err := config.DefaultBeforeLoad(ctx, c); err != nil && !c.opts.AllowFail {
|
||||||
@ -153,6 +157,10 @@ func (c *consulConfig) Load(ctx context.Context, opts ...options.Option) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *consulConfig) Save(ctx context.Context, opts ...options.Option) error {
|
func (c *consulConfig) Save(ctx context.Context, opts ...options.Option) error {
|
||||||
|
if c.opts.SkipSave != nil && c.opts.SkipSave(ctx, c) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
options := config.NewSaveOptions(opts...)
|
options := config.NewSaveOptions(opts...)
|
||||||
|
|
||||||
if err := config.DefaultBeforeSave(ctx, c); err != nil && !c.opts.AllowFail {
|
if err := config.DefaultBeforeSave(ctx, c); err != nil && !c.opts.AllowFail {
|
||||||
|
Loading…
Reference in New Issue
Block a user