Add asyncRunner in the periodic callbacks
This commit is contained in:
parent
5b1b97a161
commit
9553b28132
@ -142,6 +142,8 @@ define([ "core", "underscore" ], function(core) {
|
||||
// Use defer to avoid stack overflow
|
||||
_.defer(runTask);
|
||||
};
|
||||
// Run runTask function periodically
|
||||
core.addPeriodicCallback(asyncRunner.runTask);
|
||||
|
||||
function runSafe(task, callbacks, param) {
|
||||
try {
|
||||
|
2
js/main-min.js
vendored
2
js/main-min.js
vendored
File diff suppressed because one or more lines are too long
@ -35,6 +35,8 @@ define(["jquery", "core", "github-provider", "blogger-provider", "dropbox-provid
|
||||
$(".action-force-publish").removeClass("disabled");
|
||||
}
|
||||
};
|
||||
// Run updatePublishButton function on online/offline event
|
||||
core.addOfflineListener(publisher.updatePublishButton);
|
||||
|
||||
// Apply template to the current document
|
||||
publisher.applyTemplate = function(publishAttributes) {
|
||||
@ -204,8 +206,6 @@ define(["jquery", "core", "github-provider", "blogger-provider", "dropbox-provid
|
||||
};
|
||||
|
||||
$(function() {
|
||||
core.addOfflineListener(publisher.updatePublishButton);
|
||||
|
||||
// Init each provider
|
||||
_.each(providerMap, function(provider) {
|
||||
// Publish provider button
|
||||
|
@ -28,6 +28,8 @@ define(["jquery", "core", "dropbox-provider", "gdrive-provider", "underscore"],
|
||||
$(".action-force-sync").removeClass("disabled");
|
||||
}
|
||||
};
|
||||
// Run updateSyncButton on online/offline event
|
||||
core.addOfflineListener(synchronizer.updateSyncButton);
|
||||
|
||||
// Force the synchronization
|
||||
synchronizer.forceSync = function() {
|
||||
@ -181,6 +183,8 @@ define(["jquery", "core", "dropbox-provider", "gdrive-provider", "underscore"],
|
||||
});
|
||||
});
|
||||
};
|
||||
// Run sync function periodically
|
||||
core.addPeriodicCallback(synchronizer.sync);
|
||||
|
||||
// Used to populate the "Manage synchronization" dialog
|
||||
var lineTemplate = ['<div class="input-prepend input-append">',
|
||||
@ -233,9 +237,6 @@ define(["jquery", "core", "dropbox-provider", "gdrive-provider", "underscore"],
|
||||
};
|
||||
|
||||
$(function() {
|
||||
core.addOfflineListener(synchronizer.updateSyncButton);
|
||||
core.addPeriodicCallback(synchronizer.sync);
|
||||
|
||||
// Init each provider
|
||||
_.each(providerMap, function(provider) {
|
||||
// Provider's import button
|
||||
|
Loading…
Reference in New Issue
Block a user