jack-richards / bptf-autopricer

Automatically prices items using listing data from backpack.tf, with data from prices.tf acting as a baseline.
MIT License
28 stars 6 forks source link

Rate Limit Issue #17

Closed AlexLKW closed 3 weeks ago

AlexLKW commented 1 month ago

Currently running a pricelist of around 2000 items and received lots of 429 Too Many Request errors.

2|bptf-aut |       '<head><title>429 Too Many Requests</title></head>\r\n' +
2|bptf-aut |       '<body>\r\n' +
2|bptf-aut |       '<center><h1>429 Too Many Requests</h1></center>\r\n' +
2|bptf-aut |       '<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n' +
2|bptf-aut |       `<script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'8b3d34cd2c181109',t:'MTcyMzc2NzA3OC4wMDAwMDA='};var a=document.createElement('script');a.nonce='';a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body>\r\n` +
2|bptf-aut |       '</html>\r\n'
2|bptf-aut |   }
2|bptf-aut | }
2|bptf-aut | Couldn't create a price for Abyssal Aura El Zapateador
jack-richards commented 3 weeks ago

Backpack.tf has a global rate limit, so if you are running tf2autobot on the same server as the pricer you may run into issues. You could be getting rate-limited by using the same bptf token for both applications and/or because both applications use the same IP address.

For larger pricelists, I developed the alwaysQuerySnapshotAPI config option, which may help you here. See the section in the readme for more information as it does have some trade-offs: https://github.com/jack-richards/bptf-autopricer?tab=readme-ov-file#alwaysquerysnapshotapi