|
|
@@ -137,7 +137,7 @@ export class ProviderVideoSyncService {
|
|
|
|
|
|
private lastSyncSummary: ProviderVideoSyncResult | null = null;
|
|
|
|
|
|
- private readonly MAX_PAGE_SIZE = 500;
|
|
|
+ private readonly MAX_PAGE_SIZE = 15000;
|
|
|
private readonly DEFAULT_PAGE_SIZE = 500;
|
|
|
private readonly BATCH_SIZE = 100;
|
|
|
private readonly BASELINE_PARTIAL_COUNT = 20000;
|
|
|
@@ -160,6 +160,10 @@ export class ProviderVideoSyncService {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ this.logger.log(
|
|
|
+ `[syncFromProvider] options=${JSON.stringify(options)} apiUrl=${providerApiUrl}`,
|
|
|
+ );
|
|
|
+
|
|
|
const defaultPageSize = providerConfig.itemsLimit ?? this.DEFAULT_PAGE_SIZE;
|
|
|
const requestedPageSize = options.pageSize ?? defaultPageSize;
|
|
|
const pageSize = this.clampInt(requestedPageSize, 1, this.MAX_PAGE_SIZE);
|
|
|
@@ -542,7 +546,7 @@ export class ProviderVideoSyncService {
|
|
|
},
|
|
|
): Promise<RawProviderVideo[]> {
|
|
|
try {
|
|
|
- // Provider expects { data: "<json string>" } (based on code=400 Field=data expecting string)
|
|
|
+ // Provider expects { data: JSON.stringify(...) } (API enforces data field as string).
|
|
|
const wrappedBody = {
|
|
|
data: JSON.stringify({
|
|
|
pageNum: body.pageNum,
|
|
|
@@ -551,8 +555,14 @@ export class ProviderVideoSyncService {
|
|
|
}),
|
|
|
};
|
|
|
|
|
|
+ const jsonBody = {
|
|
|
+ pageNum: body.pageNum,
|
|
|
+ pageSize: body.pageSize,
|
|
|
+ param: body.param,
|
|
|
+ };
|
|
|
+
|
|
|
const response = await firstValueFrom(
|
|
|
- this.httpService.post(apiUrl, wrappedBody, {
|
|
|
+ this.httpService.post(apiUrl, jsonBody, {
|
|
|
headers: { 'Content-Type': 'application/json' },
|
|
|
timeout: 30_000,
|
|
|
}),
|
|
|
@@ -565,7 +575,7 @@ export class ProviderVideoSyncService {
|
|
|
this.logger.log(
|
|
|
`[fetchPage] Provider response preview: ${JSON.stringify(
|
|
|
providerJson,
|
|
|
- ).slice(0, 400)}...`,
|
|
|
+ ).slice(0, 800)}...`,
|
|
|
);
|
|
|
|
|
|
// Fail fast on provider errors (prevents "successful" runs with empty lists)
|