<!--
Thanks for contributing to poolifier project.
- Please be sure to read our [contributing guidelines](https://github.com/pioardi/poolifier/blob/pr-template/CONTRIBUTING.md).
+ Please be sure to read our [contributing guidelines](https://github.com/poolifier/poolifier/blob/pr-template/CONTRIBUTING.md).
-->
## PR Checklist
CI: true
- name: Sonar Code Analysis
- if: "github.repository == 'pioardi/poolifier' && matrix.node-version == '14.x'"
- run: |
- npm run sonar
+ if: "github.repository == 'poolifier/poolifier' && matrix.node-version == '14.x'"
+ uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.USER_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
npm run typedoc
- name: Commit files
- if: "github.repository == 'pioardi/poolifier' && github.ref == 'refs/heads/master'"
+ if: "github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/master'"
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Generate TypeDoc" -a
- name: Push changes
- if: "github.repository == 'pioardi/poolifier' && github.ref == 'refs/heads/master'"
+ if: "github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/master'"
uses: ad-m/github-push-action@master
with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
+ github_token: ${{ secrets.USER_TOKEN }}
branch: master
if: ${{ contains(steps.package-version.outputs.version, '-') == false }}
run: npm publish
env:
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Publish Beta
if: ${{ contains(steps.package-version.outputs.version, 'beta') }}
run: npm publish --tag beta
env:
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
"dev": true
},
"@types/node": {
- "version": "14.17.10",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.10.tgz",
- "integrity": "sha512-09x2d6kNBwjHgyh3jOUE2GE4DFoxDriDvWdu6mFhMP1ysynGYazt4ecZmJlL6/fe4Zi2vtYvTvtL7epjQQrBhA==",
+ "version": "14.17.11",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.11.tgz",
+ "integrity": "sha512-n2OQ+0Bz6WEsUjrvcHD1xZ8K+Kgo4cn9/w94s1bJS690QMUWfJPW/m7CCb7gPkA1fcYwL2UpjXP/rq/Eo41m6w==",
"dev": true
},
"@types/parse-json": {
"dev": true
},
"mocha": {
- "version": "9.0.3",
- "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.0.3.tgz",
- "integrity": "sha512-hnYFrSefHxYS2XFGtN01x8un0EwNu2bzKvhpRFhgoybIvMaOkkL60IVPmkb5h6XDmUl4IMSB+rT5cIO4/4bJgg==",
+ "version": "9.1.0",
+ "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.0.tgz",
+ "integrity": "sha512-Kjg/XxYOFFUi0h/FwMOeb6RoroiZ+P1yOfya6NK7h3dNhahrJx1r2XIT3ge4ZQvJM86mdjNA+W5phqRQh7DwCg==",
"dev": true,
"requires": {
"@ungap/promise-all-settled": "1.1.2",
}
}
},
- "sonar-scanner": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/sonar-scanner/-/sonar-scanner-3.1.0.tgz",
- "integrity": "sha1-UcHBEB9UuYq8XYVlIJsdkjKXk0M=",
- "dev": true
- },
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"test": "npm run build && nyc mocha 'tests/**/*.test.js'",
"test:debug": "npm run build && mocha --no-parallel --inspect 'tests/**/*.test.js'",
"test:prod": "npm run build:prod && nyc mocha 'tests/**/*.test.js'",
- "sonar": "sonar-scanner",
"coverage": "nyc report --reporter=lcov",
"coverage:html": "nyc report --reporter=html",
"format": "prettier --loglevel silent --write .; prettierx --write .",
"lib"
],
"devDependencies": {
- "@types/node": "^14.17.10",
+ "@types/node": "^14.17.11",
"@typescript-eslint/eslint-plugin": "^4.29.2",
"@typescript-eslint/parser": "^4.29.2",
"benchmark": "^2.1.4",
"eslint-plugin-spellcheck": "0.0.19",
"expect": "^27.0.6",
"microtime": "^3.0.0",
- "mocha": "^9.0.3",
+ "mocha": "^9.1.0",
"mochawesome": "^6.2.2",
"nyc": "^15.1.0",
"prettier": "^2.3.2",
"rollup-plugin-istanbul": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.30.0",
- "sonar-scanner": "^3.1.0",
"source-map-support": "^0.5.19",
"typedoc": "^0.21.6",
"typescript": "^4.3.5"
sonar.host.url=https://sonarcloud.io
sonar.sources=src
sonar.tests=tests
-# sonar.login=TOKEN #To use for local troubleshooting
+#sonar.login=TOKEN # To use for local troubleshooting
sonar.verbose=false
sonar.scm.exclusions.disabled=true
Worker extends IWorker,
Data = unknown,
Response = unknown
-> implements IPoolInternal<Worker, Data, Response>
-{
+> implements IPoolInternal<Worker, Data, Response> {
/** @inheritdoc */
public readonly workers: Worker[] = []
* @template Response Type of response of execution. This can only be serializable data.
*/
class RoundRobinWorkerChoiceStrategy<Worker extends IWorker, Data, Response>
- implements IWorkerChoiceStrategy<Worker>
-{
+ implements IWorkerChoiceStrategy<Worker> {
/**
* Index for the next worker.
*/
Worker extends IWorker,
Data,
Response
-> implements IWorkerChoiceStrategy<Worker>
-{
+> implements IWorkerChoiceStrategy<Worker> {
/**
* Constructs a worker choice strategy that selects based on less recently used.
*
* @template Response Type of response of execution. This can only be serializable data.
*/
class DynamicPoolWorkerChoiceStrategy<Worker extends IWorker, Data, Response>
- implements IWorkerChoiceStrategy<Worker>
-{
+ implements IWorkerChoiceStrategy<Worker> {
private workerChoiceStrategy: IWorkerChoiceStrategy<Worker>
/**
private createDynamicallyWorkerCallback: () => Worker,
workerChoiceStrategy: WorkerChoiceStrategy = WorkerChoiceStrategies.ROUND_ROBIN
) {
- this.workerChoiceStrategy =
- SelectionStrategiesUtils.getWorkerChoiceStrategy(
- this.pool,
- workerChoiceStrategy
- )
+ this.workerChoiceStrategy = SelectionStrategiesUtils.getWorkerChoiceStrategy(
+ this.pool,
+ workerChoiceStrategy
+ )
}
/** @inheritdoc */
public setWorkerChoiceStrategy (
workerChoiceStrategy: WorkerChoiceStrategy
): void {
- this.workerChoiceStrategy =
- this.getPoolWorkerChoiceStrategy(workerChoiceStrategy)
+ this.workerChoiceStrategy = this.getPoolWorkerChoiceStrategy(
+ workerChoiceStrategy
+ )
}
/**
* @returns Message of the error.
*/
protected handleError (e: Error | string): string {
- return e as unknown as string
+ return (e as unknown) as string
}
/**