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

This commit is contained in:
Jonathan Budzenski 2019-02-21 11:28:01 -06:00 committed by GitHub
parent 3d7a6a19fd
commit 8ef0ea7fab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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);