fix(events): refresh saved payout calendars once per hourly pass (WealthLedger/backend#53) (#157)
Backend verify / commits (push) Skipped
Backend verify / security (push) Successful in 1m6s
Backend verify / verify (push) Failing after 6m50s

This commit was merged in pull request #157.
This commit is contained in:
2026-11-02 23:06:14 +03:00
parent 169bee1da5
commit aeb4647fda
4 changed files with 131 additions and 2 deletions
@@ -185,6 +185,7 @@ export class UpcomingEventsService {
userId: string,
accountId: string,
query: UpcomingEventsQueryDto = {},
walkStartedAt?: Date,
): Promise<string[]> {
const window = dateWindow(query);
await this.access.local(userId, accountId);
@@ -195,6 +196,7 @@ export class UpcomingEventsService {
positions,
window,
false,
walkStartedAt,
);
return launched;
}
@@ -204,6 +206,7 @@ export class UpcomingEventsService {
positions: Position[],
window: { from: string; to: string },
observe: boolean,
refreshBefore?: Date,
) {
const metadata = await this.metadata.savedMany(positions);
const sources: Awaited<ReturnType<CatalogEnrichmentService['readMany']>> =
@@ -229,6 +232,7 @@ export class UpcomingEventsService {
identities.map((entry) => [entry.uid, entry.ticker]),
),
},
refreshBefore,
);
sources.push(...batch);
for (const source of batch) {