feat: add hourly portfolio sync history
This commit is contained in:
@@ -128,7 +128,7 @@ export type OperationCoverage = OperationInterval & {
|
||||
asOf: Date;
|
||||
fetchedAt: Date;
|
||||
};
|
||||
const operationsFreshForMs = 300_000;
|
||||
const operationsFreshForMs = 3_600_000;
|
||||
|
||||
export function planOperationRead(
|
||||
requested: OperationInterval[],
|
||||
@@ -188,8 +188,9 @@ export function planOperationRead(
|
||||
.filter((row) => row.from < row.to),
|
||||
fresh.map((row) => ({ ...row, instrumentUid: target.instrumentUid })),
|
||||
).length > EMPTY_INTERVAL_COUNT;
|
||||
// The mutable tail is owned by the hourly walk; reads only load what is
|
||||
// missing, never re-verify complete or fresh intervals.
|
||||
if (options.force) load.push(target);
|
||||
else if (stale) load.push({ ...target, from: monthStart, to: now });
|
||||
else load.push(...missing);
|
||||
// Completeness is bounded by the observed end, never by the new wall clock.
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user