feat: youtube upload can't have concurrency as it can be a long request
This commit is contained in:
parent
0df9fd392e
commit
2db252f97f
|
|
@ -38,11 +38,17 @@ export abstract class SocialAbstract {
|
||||||
d: { query: string },
|
d: { query: string },
|
||||||
id: string,
|
id: string,
|
||||||
integration: Integration
|
integration: Integration
|
||||||
): Promise<{ id: string; label: string; image: string, doNotCache?: boolean }[] | { none: true }> {
|
): Promise<
|
||||||
|
| { id: string; label: string; image: string; doNotCache?: boolean }[]
|
||||||
|
| { none: true }
|
||||||
|
> {
|
||||||
return { none: true };
|
return { none: true };
|
||||||
}
|
}
|
||||||
|
|
||||||
async runInConcurrent<T>(func: (...args: any[]) => Promise<T>) {
|
async runInConcurrent<T>(
|
||||||
|
func: (...args: any[]) => Promise<T>,
|
||||||
|
ignoreConcurrency?: boolean
|
||||||
|
) {
|
||||||
const value = await concurrency<any>(
|
const value = await concurrency<any>(
|
||||||
this.identifier,
|
this.identifier,
|
||||||
this.maxConcurrentJob,
|
this.maxConcurrentJob,
|
||||||
|
|
@ -54,7 +60,8 @@ export abstract class SocialAbstract {
|
||||||
const handle = this.handleErrors(JSON.stringify(err));
|
const handle = this.handleErrors(JSON.stringify(err));
|
||||||
return { err: true, ...(handle || {}) };
|
return { err: true, ...(handle || {}) };
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
ignoreConcurrency
|
||||||
);
|
);
|
||||||
|
|
||||||
if (value && value?.err && value?.value) {
|
if (value && value?.err && value?.value) {
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,8 @@ export class YoutubeProvider extends SocialAbstract implements SocialProvider {
|
||||||
media: {
|
media: {
|
||||||
body: response.data,
|
body: response.data,
|
||||||
},
|
},
|
||||||
})
|
}),
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
if (settings?.thumbnail?.path) {
|
if (settings?.thumbnail?.path) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue