From 4ee2eb4a2ae25c4a5a4dfbace358613597389adc Mon Sep 17 00:00:00 2001 From: IdiNium <47635037+idinium96@users.noreply.github.com> Date: Thu, 7 Jul 2022 05:45:35 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20increase=20pollInterval=20to=20e?= =?UTF-8?q?very=201=20minute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/Bot.ts | 6 ++++-- src/classes/Commands/sub-classes/Manager.ts | 2 +- src/classes/Trades.ts | 5 +---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/classes/Bot.ts b/src/classes/Bot.ts index 640a0d447..b61544c99 100644 --- a/src/classes/Bot.ts +++ b/src/classes/Bot.ts @@ -150,7 +150,9 @@ export default class Bot { language: 'en', pollInterval: -1, cancelTime: 15 * 60 * 1000, - pendingCancelTime: 1.5 * 60 * 1000 + pendingCancelTime: 1.5 * 60 * 1000, + globalAssetCache: true, + assetCacheMaxItems: 50 }); this.bptf = new BptfLogin(); @@ -1035,7 +1037,7 @@ export default class Bot { return resolve(); } - this.manager.pollInterval = 5 * 1000; + this.manager.pollInterval = 60 * 1000; this.setReady = true; this.handler.onReady(); this.manager.doPoll(); diff --git a/src/classes/Commands/sub-classes/Manager.ts b/src/classes/Commands/sub-classes/Manager.ts index 4f2a9f527..d3c4c9915 100644 --- a/src/classes/Commands/sub-classes/Manager.ts +++ b/src/classes/Commands/sub-classes/Manager.ts @@ -931,7 +931,7 @@ export default class ManagerCommands { // Bring back online this.bot.client.setPersona(EPersonaState.Online); this.bot.handler.isUpdatingStatus = false; - this.bot.manager.pollInterval = 5 * 1000; + this.bot.manager.pollInterval = 60 * 1000; }; try { diff --git a/src/classes/Trades.ts b/src/classes/Trades.ts index 8477f4da2..c102a66e5 100644 --- a/src/classes/Trades.ts +++ b/src/classes/Trades.ts @@ -138,10 +138,7 @@ export default class Trades { const activeReceived = received.filter(offer => offer.state === TradeOfferManager.ETradeOfferState['Active']); const activeReceivedCount = activeReceived.length; - if ( - filter === TradeOfferManager.EOfferFilter['ActiveOnly'] && - (this.pollCount * this.bot.manager.pollInterval) / (2 * 5 * 60 * 1000) >= 1 - ) { + if (filter === TradeOfferManager.EOfferFilter['ActiveOnly'] && this.pollCount / 5 >= 1) { this.pollCount = 0; const activeSent = sent.filter(offer => offer.state === TradeOfferManager.ETradeOfferState['Active']);