fix(tbank): include cursor/limit in positions cache key, add tbankPositionsTtl config
This commit is contained in:
parent
bb7fef8deb
commit
6b3bdd2aec
@ -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: {
|
||||
|
||||
@ -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<
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user