mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 08:27:24 -06:00
Improve free disk space checking for WebAPI
Use single free disk space checker instance for all the web sessions. PR #19855. Closes #19732.
This commit is contained in:
committed by
GitHub
parent
30d9978c97
commit
c88bd7cb3f
@@ -28,22 +28,17 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include <QVariantMap>
|
||||
#include <QSet>
|
||||
#include <QVariantMap>
|
||||
|
||||
#include "base/bittorrent/infohash.h"
|
||||
#include "apicontroller.h"
|
||||
|
||||
class QThread;
|
||||
|
||||
namespace BitTorrent
|
||||
{
|
||||
class Torrent;
|
||||
}
|
||||
|
||||
class FreeDiskSpaceChecker;
|
||||
|
||||
class SyncController : public APIController
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -54,14 +49,14 @@ public:
|
||||
|
||||
explicit SyncController(IApplication *app, QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void updateFreeDiskSpace(qint64 freeDiskSpace);
|
||||
|
||||
private slots:
|
||||
void maindataAction();
|
||||
void torrentPeersAction();
|
||||
|
||||
private:
|
||||
qint64 getFreeDiskSpace();
|
||||
void invokeChecker();
|
||||
|
||||
void makeMaindataSnapshot();
|
||||
QJsonObject generateMaindataSyncData(int id, bool fullUpdate);
|
||||
|
||||
@@ -85,8 +80,6 @@ private:
|
||||
void onTorrentTrackersChanged(BitTorrent::Torrent *torrent);
|
||||
|
||||
qint64 m_freeDiskSpace = 0;
|
||||
QElapsedTimer m_freeDiskSpaceElapsedTimer;
|
||||
bool m_isFreeDiskSpaceCheckerRunning = false;
|
||||
|
||||
QVariantMap m_lastPeersResponse;
|
||||
QVariantMap m_lastAcceptedPeersResponse;
|
||||
|
||||
Reference in New Issue
Block a user