[Build] Revert setTimeout changes
Restore usage of setTimeout (instead of the Angular-wrapped version) per https://github.com/nasa/openmct/pull/724#issuecomment-193542314
This commit is contained in:
@@ -103,7 +103,6 @@ define([
|
|||||||
"type": "provider",
|
"type": "provider",
|
||||||
"implementation": GenericSearchProvider,
|
"implementation": GenericSearchProvider,
|
||||||
"depends": [
|
"depends": [
|
||||||
"$timeout",
|
|
||||||
"$q",
|
"$q",
|
||||||
"$log",
|
"$log",
|
||||||
"modelService",
|
"modelService",
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
/*global setTimeout*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Module defining GenericSearchProvider. Created by shale on 07/16/2015.
|
* Module defining GenericSearchProvider. Created by shale on 07/16/2015.
|
||||||
@@ -41,9 +42,8 @@ define([
|
|||||||
* @param {TopicService} topic the topic service.
|
* @param {TopicService} topic the topic service.
|
||||||
* @param {Array} ROOTS An array of object Ids to begin indexing.
|
* @param {Array} ROOTS An array of object Ids to begin indexing.
|
||||||
*/
|
*/
|
||||||
function GenericSearchProvider($timeout, $q, $log, modelService, workerService, topic, ROOTS) {
|
function GenericSearchProvider($q, $log, modelService, workerService, topic, ROOTS) {
|
||||||
var provider = this;
|
var provider = this;
|
||||||
this.$timeout = $timeout;
|
|
||||||
this.$q = $q;
|
this.$q = $q;
|
||||||
this.$log = $log;
|
this.$log = $log;
|
||||||
this.modelService = modelService;
|
this.modelService = modelService;
|
||||||
@@ -193,8 +193,7 @@ define([
|
|||||||
*/
|
*/
|
||||||
GenericSearchProvider.prototype.beginIndexRequest = function () {
|
GenericSearchProvider.prototype.beginIndexRequest = function () {
|
||||||
var idToIndex = this.idsToIndex.shift(),
|
var idToIndex = this.idsToIndex.shift(),
|
||||||
provider = this,
|
provider = this;
|
||||||
$timeout = this.$timeout;
|
|
||||||
|
|
||||||
this.pendingRequests += 1;
|
this.pendingRequests += 1;
|
||||||
this.modelService
|
this.modelService
|
||||||
@@ -210,10 +209,10 @@ define([
|
|||||||
.warn('Failed to index domain object ' + idToIndex);
|
.warn('Failed to index domain object ' + idToIndex);
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
$timeout(function () {
|
setTimeout(function () {
|
||||||
provider.pendingRequests -= 1;
|
provider.pendingRequests -= 1;
|
||||||
provider.keepIndexing();
|
provider.keepIndexing();
|
||||||
}, 0, false);
|
}, 0);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,7 @@ define([
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
describe('GenericSearchProvider', function () {
|
describe('GenericSearchProvider', function () {
|
||||||
var $timeout,
|
var $q,
|
||||||
$q,
|
|
||||||
$log,
|
$log,
|
||||||
modelService,
|
modelService,
|
||||||
models,
|
models,
|
||||||
@@ -43,7 +42,6 @@ define([
|
|||||||
provider;
|
provider;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
$timeout = jasmine.createSpy('$timeout');
|
|
||||||
$q = jasmine.createSpyObj(
|
$q = jasmine.createSpyObj(
|
||||||
'$q',
|
'$q',
|
||||||
['defer']
|
['defer']
|
||||||
@@ -82,12 +80,7 @@ define([
|
|||||||
|
|
||||||
spyOn(GenericSearchProvider.prototype, 'scheduleForIndexing');
|
spyOn(GenericSearchProvider.prototype, 'scheduleForIndexing');
|
||||||
|
|
||||||
$timeout.andCallFake(function (callback, millis) {
|
|
||||||
window.setTimeout(callback, millis);
|
|
||||||
});
|
|
||||||
|
|
||||||
provider = new GenericSearchProvider(
|
provider = new GenericSearchProvider(
|
||||||
$timeout,
|
|
||||||
$q,
|
$q,
|
||||||
$log,
|
$log,
|
||||||
modelService,
|
modelService,
|
||||||
|
|||||||
Reference in New Issue
Block a user