Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
levb committed Nov 5, 2024
1 parent 9bc5e7f commit a15d5a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
15 changes: 8 additions & 7 deletions src/micro.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,16 @@ _attach_service_to_connection(natsConnection *nc, microService *service)
else
nc->services = tmp;
}
}

if (s == NATS_OK)
{
service->refs++; // no lock needed, called from the constructor
nc->services[nc->numServices] = service;
nc->numServices++;
if (s == NATS_OK)
{
service->refs++; // no lock needed, called from the constructor
nc->services[nc->numServices] = service;
nc->numServices++;
}
natsMutex_Unlock(nc->servicesMu);
}
natsMutex_Unlock(nc->servicesMu);

natsConn_Unlock(nc);

return micro_ErrorFromStatus(s);
Expand Down
3 changes: 1 addition & 2 deletions src/micro_endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ micro_clone_endpoint_config(microEndpointConfig **out, microEndpointConfig *cfg)
microEndpointConfig *new_cfg = NULL;

if (out == NULL)
return microError_Wrapf(err, "failed to clone endpoint config: '%s'", cfg->Name);
return microError_Wrapf(micro_ErrorInvalidArg, "failed to clone endpoint config: '%s'", cfg->Name);

Check warning on line 282 in src/micro_endpoint.c

View check run for this annotation

Codecov / codecov/patch

src/micro_endpoint.c#L282

Added line #L282 was not covered by tests

if (cfg == NULL)
{
Expand All @@ -303,7 +303,6 @@ micro_clone_endpoint_config(microEndpointConfig **out, microEndpointConfig *cfg)
{
micro_free_cloned_endpoint_config(new_cfg);
return microError_Wrapf(err, "failed to clone endpoint config: '%s'", cfg->Name);

Check warning on line 305 in src/micro_endpoint.c

View check run for this annotation

Codecov / codecov/patch

src/micro_endpoint.c#L305

Added line #L305 was not covered by tests
return err;
}

*out = new_cfg;
Expand Down

0 comments on commit a15d5a8

Please sign in to comment.