fix(migration): лёгкий expand для документов (positions, не positions.assortment) + таймаут 130с
Тяжёлый expand=positions.assortment раскрывал весь товар в каждой позиции → страница гигантская и зависала. assortment.meta.href в позиции есть и без раскрытия. Таймаут HttpClient МойСклада поднят до 130с (страница иногда > 100с). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2ed9f04cb2
commit
f2a1493ea0
|
|
@ -433,6 +433,7 @@ [new Microsoft.OpenApi.Models.OpenApiSecurityScheme
|
|||
var baseUrl = builder.Configuration["MoySklad:BaseUrl"];
|
||||
if (!string.IsNullOrWhiteSpace(baseUrl))
|
||||
http.BaseAddress = new Uri(baseUrl);
|
||||
http.Timeout = TimeSpan.FromSeconds(130); // страница каталога/документов иногда > 100с
|
||||
})
|
||||
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler
|
||||
{
|
||||
|
|
|
|||
|
|
@ -72,8 +72,11 @@ private static DateTime MomentToUtc(string? moment)
|
|||
.Select(s => s.MoySkladExternalId!).ToListAsync(ct)).ToHashSet();
|
||||
|
||||
var batch = 0;
|
||||
// expand=positions (НЕ positions.assortment — это раскрывает весь товар и делает
|
||||
// страницу гигантской/зависающей). assortment.meta.href в позиции есть и так — из него
|
||||
// берём id товара.
|
||||
await foreach (var d in _client.StreamDocumentsAsync<MsDocument>(token, "entity/supply",
|
||||
"positions.assortment,agent,store", startOffset, null, ct))
|
||||
"positions,agent,store", startOffset, null, ct))
|
||||
{
|
||||
progress.Seen++;
|
||||
if (d.Id is null || done.Contains(d.Id)) { progress.Skipped++; continue; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue