fix(sync): start hourly operations after portfolio works finish (#201) (#202)
Backend verify / commits (push) Skipped
Backend verify / security (push) Successful in 1m23s
Backend verify / verify (push) Failing after 8m11s

This commit was merged in pull request #202.
This commit is contained in:
2026-11-11 09:29:08 +03:00
parent fee61537b6
commit 85d65f8997
2 changed files with 31 additions and 1 deletions
@@ -244,16 +244,23 @@ export class TbankHourlyScheduler implements OnModuleDestroy, OnModuleInit {
dispatchProblems: HourlySection[],
walkStartedAt: Date,
) {
const portfolios: string[] = [];
for (const account of accounts) {
await this.dispatchPortfolio(
userId,
revision,
account.accountId,
dispatch,
async (child) => {
portfolios.push(child.id);
await dispatch(child);
},
dispatchProblems,
walkStartedAt,
);
}
// Operations coverage must end after the Portfolio valuation it explains:
// performance requires coverage up to the snapshot fetchedAt.
await this.waitWorks(userId, portfolios);
for (const account of accounts) {
await this.dispatchOperations(
userId,