fix(core): update
This commit is contained in:
		@@ -37,18 +37,6 @@ snyk:
 | 
				
			|||||||
# ====================
 | 
					# ====================
 | 
				
			||||||
# test stage
 | 
					# test stage
 | 
				
			||||||
# ====================
 | 
					# ====================
 | 
				
			||||||
testLEGACY:
 | 
					 | 
				
			||||||
  stage: test
 | 
					 | 
				
			||||||
  script:
 | 
					 | 
				
			||||||
  - npmci npm prepare
 | 
					 | 
				
			||||||
  - npmci node install legacy
 | 
					 | 
				
			||||||
  - npmci npm install
 | 
					 | 
				
			||||||
  - npmci npm test
 | 
					 | 
				
			||||||
  coverage: /\d+.?\d+?\%\s*coverage/
 | 
					 | 
				
			||||||
  tags:
 | 
					 | 
				
			||||||
  - docker
 | 
					 | 
				
			||||||
  - notpriv
 | 
					 | 
				
			||||||
  allow_failure: true
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
testLTS:
 | 
					testLTS:
 | 
				
			||||||
  stage: test
 | 
					  stage: test
 | 
				
			||||||
@@ -135,13 +123,3 @@ pages:
 | 
				
			|||||||
    paths:
 | 
					    paths:
 | 
				
			||||||
    - public
 | 
					    - public
 | 
				
			||||||
  allow_failure: true
 | 
					  allow_failure: true
 | 
				
			||||||
 | 
					 | 
				
			||||||
windowsCompatibility:
 | 
					 | 
				
			||||||
  image: stefanscherer/node-windows:10-build-tools
 | 
					 | 
				
			||||||
  stage: metadata
 | 
					 | 
				
			||||||
  script:
 | 
					 | 
				
			||||||
  - npm install & npm test
 | 
					 | 
				
			||||||
  coverage: /\d+.?\d+?\%\s*coverage/
 | 
					 | 
				
			||||||
  tags:
 | 
					 | 
				
			||||||
  - windows
 | 
					 | 
				
			||||||
  allow_failure: true
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,4 +31,4 @@
 | 
				
			|||||||
    "@types/elasticsearch": "^5.0.28",
 | 
					    "@types/elasticsearch": "^5.0.28",
 | 
				
			||||||
    "elasticsearch": "^15.2.0"
 | 
					    "elasticsearch": "^15.2.0"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -44,15 +44,18 @@ export class ElasticIndex {
 | 
				
			|||||||
          if (todayAsUnix - rententionPeriodAsUnix > dateAsUnix) {
 | 
					          if (todayAsUnix - rententionPeriodAsUnix > dateAsUnix) {
 | 
				
			||||||
            console.log(`found old index ${indexName}`);
 | 
					            console.log(`found old index ${indexName}`);
 | 
				
			||||||
            const done2 = plugins.smartpromise.defer();
 | 
					            const done2 = plugins.smartpromise.defer();
 | 
				
			||||||
            this.elasticSearchRef.client.indices.delete({
 | 
					            this.elasticSearchRef.client.indices.delete(
 | 
				
			||||||
              index: indexName
 | 
					              {
 | 
				
			||||||
            }, (err2, response2) => {
 | 
					                index: indexName
 | 
				
			||||||
              if(err2) {
 | 
					              },
 | 
				
			||||||
                console.log(err2);
 | 
					              (err2, response2) => {
 | 
				
			||||||
 | 
					                if (err2) {
 | 
				
			||||||
 | 
					                  console.log(err2);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                console.log(`deleted ${indexName}`);
 | 
				
			||||||
 | 
					                done2.resolve();
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
              console.log(`deleted ${indexName}`);
 | 
					            );
 | 
				
			||||||
              done2.resolve();
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
            await done2.promise;
 | 
					            await done2.promise;
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,7 +35,7 @@ export class ElasticSearch<T> {
 | 
				
			|||||||
   */
 | 
					   */
 | 
				
			||||||
  constructor(optionsArg: IElasticSearchConstructorOptions) {
 | 
					  constructor(optionsArg: IElasticSearchConstructorOptions) {
 | 
				
			||||||
    this.client = new ElasticClient({
 | 
					    this.client = new ElasticClient({
 | 
				
			||||||
      host: this.computeHostString(optionsArg),
 | 
					      host: this.computeHostString(optionsArg)
 | 
				
			||||||
      // log: 'trace'
 | 
					      // log: 'trace'
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    this.indexPrefix = optionsArg.indexPrefix;
 | 
					    this.indexPrefix = optionsArg.indexPrefix;
 | 
				
			||||||
@@ -61,10 +61,10 @@ export class ElasticSearch<T> {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  public async log(logPackageArg: ILogPackage, scheduleOverwrite = false) {
 | 
					  public async log(logPackageArg: ILogPackage, scheduleOverwrite = false) {
 | 
				
			||||||
    const now = new Date();
 | 
					    const now = new Date();
 | 
				
			||||||
    const indexToUse = `${this.indexPrefix}-${now.getFullYear()}.${('0' + (now.getMonth() + 1)).slice(-2)}.${(
 | 
					    const indexToUse = `${this.indexPrefix}-${now.getFullYear()}.${(
 | 
				
			||||||
      '0' + now.getDate()
 | 
					      '0' +
 | 
				
			||||||
    ).slice(-2)}`;
 | 
					      (now.getMonth() + 1)
 | 
				
			||||||
 | 
					    ).slice(-2)}.${('0' + now.getDate()).slice(-2)}`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (this.elasticScheduler.docsScheduled && !scheduleOverwrite) {
 | 
					    if (this.elasticScheduler.docsScheduled && !scheduleOverwrite) {
 | 
				
			||||||
      this.elasticScheduler.scheduleDoc(logPackageArg);
 | 
					      this.elasticScheduler.scheduleDoc(logPackageArg);
 | 
				
			||||||
@@ -94,11 +94,11 @@ export class ElasticSearch<T> {
 | 
				
			|||||||
    );
 | 
					    );
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  get logDestination (): ILogDestination {
 | 
					  get logDestination(): ILogDestination {
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
      handleLog: (smartlogPackageArg: ILogPackage) => {
 | 
					      handleLog: (smartlogPackageArg: ILogPackage) => {
 | 
				
			||||||
        this.log(smartlogPackageArg);
 | 
					        this.log(smartlogPackageArg);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    };
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user