Skip to content

Commit

Permalink
Move return inside the lock
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Sep 7, 2023
1 parent f005176 commit cdd760b
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,21 +230,21 @@ def collect(self) -> Optional[MetricsData]:
instrument.instrumentation_scope
].metrics.extend(metrics)

if instrumentation_scope_scope_metrics:

return MetricsData(
resource_metrics=[
ResourceMetrics(
resource=self._sdk_config.resource,
scope_metrics=list(
instrumentation_scope_scope_metrics.values()
),
schema_url=self._sdk_config.resource.schema_url,
)
]
)
if instrumentation_scope_scope_metrics:

return MetricsData(
resource_metrics=[
ResourceMetrics(
resource=self._sdk_config.resource,
scope_metrics=list(
instrumentation_scope_scope_metrics.values()
),
schema_url=self._sdk_config.resource.schema_url,
)
]
)

return None
return None

def _handle_view_instrument_match(
self,
Expand Down

0 comments on commit cdd760b

Please sign in to comment.