src/main/webapp/js/corpora.js
/**
	 * Keep requesting the status of the current index until it's no longer indexing.
	 * The update handler will be called periodically while the status is "indexing", and then once more when the status has changed to something other than "indexing".
	 *
	 * @param {string} indexId full id including any username
	 */
Keep requesting the status of the current index until it's no longer indexing.
The update handler will be called periodically while the status is "indexing", and then once more when the status has changed to something other than "indexing".

@param {string} indexId full id including any username
Keep requesting the status of the current index until it ' s no longer indexing . The update handler will be called periodically while the status is " indexing " and then once more when the status has changed to something other than " indexing " . @param { string } indexId full id including any username
function refreshIndexStatusWhileIndexing(indexId) {
		var statusUrl = blsUrl + indexId + '/status/';
		var timeoutHandle;
		function success(index) {
			triggers.updateCorpus(normalizeIndexData(index, indexId));
			if (index.status !== 'indexing')
				clearTimeout(timeoutHandle);
			else
				setTimeout(run, 2000);
		}
		function run() {
			$.ajax(statusUrl, {
				'type': 'GET',
				'accept': 'application/json',
				'dataType': 'json',
				'success': success,
				'error': showXHRError(
					'Could not retrieve status for corpus "' + indexId.substr(indexId.indexOf(':')+1) + '"', 
					function() {
						clearTimeout(timeoutHandle);
					}
				)
			});
		}
		timeoutHandle = setTimeout(run, 2000);
	}
function refreshIndexStatusWhileIndexing ( indexId ) { var statusUrl = blsUrl + indexId + '/status/' ; var timeoutHandle ; function success ( index ) { triggers . updateCorpus ( normalizeIndexData ( index , indexId ) ) ; if ( index . status !== 'indexing' ) clearTimeout ( timeoutHandle ) ; else setTimeout ( run , 2000 ) ; } function run ( ) { $ . ajax ( statusUrl , { 'type' : 'GET' , 'accept' : 'application/json' , 'dataType' : 'json' , 'success' : success , 'error' : showXHRError ( 'Could not retrieve status for corpus "' + indexId . substr ( indexId . indexOf ( ':' ) + 1 ) + '"' , function ( ) { clearTimeout ( timeoutHandle ) ; } ) } ) ; } timeoutHandle = setTimeout ( run , 2000 ) ; }
Keep requesting the status of the current index until it's no longer indexing.
Keep requesting the status of the current index until it ' s no longer indexing .