mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- Save less trackers errors to save memory
This commit is contained in:
parent
a9f1bd4f74
commit
495d6f2bab
2 changed files with 4 additions and 2 deletions
|
@ -40,6 +40,7 @@
|
|||
#include "deleteThread.h"
|
||||
|
||||
#define ETAS_MAX_VALUES 8
|
||||
#define MAX_TRACKER_ERRORS 2
|
||||
|
||||
// Main constructor
|
||||
bittorrent::bittorrent() : timerScan(0), DHTEnabled(false){
|
||||
|
@ -989,7 +990,7 @@ void bittorrent::readAlerts() {
|
|||
if(h.is_valid()){
|
||||
QString hash = h.hash();
|
||||
QList<QPair<QString, QString> > errors = trackersErrors.value(hash, QList<QPair<QString, QString> >());
|
||||
if(errors.size() > 5)
|
||||
if(errors.size() > MAX_TRACKER_ERRORS)
|
||||
errors.removeAt(0);
|
||||
errors << QPair<QString,QString>(QTime::currentTime().toString("hh:mm:ss"), QString::fromUtf8(a->msg().c_str()));
|
||||
trackersErrors[hash] = errors;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue