fix(tbank): include cursor/limit in positions cache key, add tbankPositionsTtl config

This commit is contained in:
Sergey Krylov 2026-06-17 14:38:51 +03:00
parent bb7fef8deb
commit 6b3bdd2aec
2 changed files with 2 additions and 1 deletions

View File

@ -32,6 +32,7 @@ export default registerAs('app', () => ({
tbankAccountsTtl: parseInt(process.env.CACHE_TBANK_ACCOUNTS_TTL || '3600', 10),
tbankPortfolioTtl: parseInt(process.env.CACHE_TBANK_PORTFOLIO_TTL || '60', 10),
tbankOperationsTtl: parseInt(process.env.CACHE_TBANK_OPERATIONS_TTL || '300', 10),
tbankPositionsTtl: parseInt(process.env.CACHE_TBANK_POSITIONS_TTL || '60', 10),
tbankInstrumentTtl: parseInt(process.env.CACHE_TBANK_INSTRUMENT_TTL || '86400', 10),
},
auth: {

View File

@ -75,7 +75,7 @@ export class BrokerPortfolioService {
const result = await this.cacheService.getOrFetch(
TBANK_CACHE_KEYS.positions,
[accountId],
[accountId, cursor ?? '', String(limit)],
async () => {
const operationsClient = this.tbankClient.getServiceClient('OperationsService') as any;
const portfolio = await this.tbankClient.callUnary<