mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Reduced memory footprint for long upload sessions
This commit is contained in:
@ -11,12 +11,14 @@ App.Promise = function(_, jQuery, progress) {
|
||||
var active = [];
|
||||
var promiseId = 0;
|
||||
|
||||
function make(callback) {
|
||||
function make(callback, useProgress) {
|
||||
var deferred = jQuery.Deferred();
|
||||
var promise = deferred.promise();
|
||||
promise.promiseId = ++ promiseId;
|
||||
|
||||
progress.start();
|
||||
if (useProgress === true) {
|
||||
progress.start();
|
||||
}
|
||||
callback(function() {
|
||||
try {
|
||||
deferred.resolve.apply(deferred, arguments);
|
||||
@ -72,7 +74,8 @@ App.Promise = function(_, jQuery, progress) {
|
||||
}
|
||||
|
||||
return {
|
||||
make: make,
|
||||
make: function(callback) { return make(callback, true); },
|
||||
makeSilent: function(callback) { return make(callback, false); },
|
||||
wait: wait,
|
||||
getActive: getActive,
|
||||
abortAll: abortAll,
|
||||
|
Reference in New Issue
Block a user