Skip to content

Commit

Permalink
Prevent logging error in offline flag check
Browse files Browse the repository at this point in the history
  • Loading branch information
bpapillon committed Oct 21, 2024
1 parent 772c1b0 commit 7036958
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/schematic_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ func (c *SchematicClient) CheckFlag(ctx context.Context, evalCtx *schematicgo.Ch
}
}()

if c.isOffline {
return c.getFlagDefault(flagKey)
}

// If nil, check flag with empty context
if evalCtx == nil {
evalCtx = &schematicgo.CheckFlagRequestBody{}
Expand All @@ -93,8 +97,7 @@ func (c *SchematicClient) CheckFlag(ctx context.Context, evalCtx *schematicgo.Ch
}
}

resp, err := c.Client.Features.CheckFlag(ctx, flagKey, evalCtx)

resp, err := c.Features.CheckFlag(ctx, flagKey, evalCtx)
if err != nil {
c.errors <- err

Expand Down

0 comments on commit 7036958

Please sign in to comment.