[monitoring] only start bulk uploader once (#31307)

This commit is contained in:
Jonathan Budzenski 2019-02-21 11:28:01 -06:00 committed by Jonathan Budzenski
parent 7937f1ae31
commit b4864042f9
No known key found for this signature in database
GPG key ID: D28BF9418FA0F292

View file

@ -66,7 +66,13 @@ export class BulkUploader {
// this is internal bulk upload, so filter out API-only collectors
const filterThem = _collectorSet => _collectorSet.getFilteredCollectorSet(c => c.ignoreForInternalUploader !== true);
this._fetchAndUpload(filterThem(collectorSet)); // initial fetch
if (this._timer) {
clearInterval(this._timer);
} else {
this._fetchAndUpload(filterThem(collectorSet)); // initial fetch
}
this._timer = setInterval(() => {
this._fetchAndUpload(filterThem(collectorSet));
}, this._interval);