mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-07 06:25:39 +02:00
opt(announce): optimization announce data
This commit is contained in:
@@ -163,7 +163,7 @@ exports.list = function (req, res) {
|
||||
];
|
||||
}
|
||||
|
||||
mtDebug.debugBlue(condition);
|
||||
mtDebug.debugBlue(condition, 'ADMIN_USERS_LIST');
|
||||
|
||||
var countQuery = function (callback) {
|
||||
User.count(condition, function (err, count) {
|
||||
|
||||
@@ -391,7 +391,7 @@ UserSchema.methods.globalUpdateMethod = function () {
|
||||
/**
|
||||
* updateSeedLeechNumbers
|
||||
*/
|
||||
UserSchema.methods.updateSeedLeechNumbers = function () {
|
||||
UserSchema.methods.updateSeedLeechNumbers = function (callback) {
|
||||
var user = this;
|
||||
|
||||
Peer.aggregate({
|
||||
@@ -424,7 +424,15 @@ UserSchema.methods.updateSeedLeechNumbers = function () {
|
||||
seeded: sc,
|
||||
leeched: lc
|
||||
}
|
||||
}).exec();
|
||||
}, function (err) {
|
||||
if (callback) {
|
||||
callback({seedCount: sc, leechCount: lc});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (callback) {
|
||||
callback(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user