Skip to content

Commit 8b73c1e

Browse files
committed
feat: stop infinite while
1 parent fb75b99 commit 8b73c1e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

libraries/nestjs-libraries/src/integrations/social/bluesky.provider.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from '@gitroom/nestjs-libraries/integrations/social/social.integrations.interface';
77
import { makeId } from '@gitroom/nestjs-libraries/services/make.is';
88
import {
9+
BadBody,
910
RefreshToken,
1011
SocialAbstract,
1112
} from '@gitroom/nestjs-libraries/integrations/social.abstract';
@@ -119,6 +120,15 @@ async function uploadVideo(
119120
if (status.jobStatus.blob) {
120121
blob = status.jobStatus.blob;
121122
}
123+
124+
if (status.jobStatus.state === 'JOB_STATE_FAILED') {
125+
throw new BadBody(
126+
'bluesky',
127+
JSON.stringify({}),
128+
{} as any,
129+
'Could not upload video, job failed'
130+
);
131+
}
122132
// wait a second
123133
await new Promise((resolve) => setTimeout(resolve, 1000));
124134
}
@@ -295,7 +305,7 @@ export class BlueskyProvider extends SocialAbstract implements SocialProvider {
295305
aspectRatio: {
296306
width: p.width,
297307
height: p.height,
298-
}
308+
},
299309
})),
300310
};
301311
}

0 commit comments

Comments
 (0)