Skip to content

Commit

Permalink
fix(resources): lint wait for async attributes for detecting resources
Browse files Browse the repository at this point in the history
  • Loading branch information
ziolekjj committed May 9, 2024
1 parent a7044f3 commit 56c21e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/opentelemetry-resources/src/detect-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ export const detectResourcesSync = (
if (isPromiseLike<Resource>(resourceOrPromise)) {
const createPromise = async () => {
const resolvedResource = await resourceOrPromise;
if (resolvedResource.waitForAsyncAttributes) {
await resolvedResource.waitForAsyncAttributes();
}
// await resolvedResource.waitForAsyncAttributes?.();
return resolvedResource.attributes;
};
resource = new Resource({}, createPromise());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('detectResourcesSync', () => {
async detect() {
return new Resource(
{ sync: 'fromsync' },
Promise.resolve({ async: 'fromasync' }).then(attrs => attrs)
Promise.resolve().then(() => ({ async: 'fromasync' }))
);
},
};
Expand Down

0 comments on commit 56c21e9

Please sign in to comment.