Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
e5f116f
link: license
jsoref Sep 1, 2025
0f4049a
link: release page
jsoref Sep 1, 2025
7f6c070
spelling: , or
jsoref Aug 31, 2025
0dd2846
spelling: ; otherwise,
jsoref Sep 1, 2025
e15b8bd
spelling: a
jsoref Aug 28, 2025
14f41c6
spelling: accumulate
jsoref Aug 28, 2025
01ab05d
spelling: accuracy
jsoref Aug 28, 2025
53253f5
spelling: acquire
jsoref Aug 28, 2025
905561f
spelling: addressed
jsoref Aug 28, 2025
f15c1ff
spelling: adjust
jsoref Aug 28, 2025
8057df5
spelling: alternatives
jsoref Aug 28, 2025
8505b38
spelling: amount
jsoref Aug 28, 2025
0f8dfb0
spelling: an
jsoref Sep 1, 2025
1864299
spelling: and
jsoref Sep 1, 2025
13f86ff
spelling: another
jsoref Sep 1, 2025
2aa9661
spelling: argument
jsoref Aug 28, 2025
07918ea
spelling: arrange
jsoref Aug 28, 2025
f800d4a
spelling: arriving
jsoref Aug 28, 2025
ec44df5
spelling: attribute
jsoref Aug 28, 2025
f893f6d
spelling: authentication
jsoref Aug 28, 2025
bb367d8
spelling: available
jsoref Aug 28, 2025
16dc216
spelling: below
jsoref Aug 28, 2025
ec7ae66
spelling: between
jsoref Aug 28, 2025
942ea93
spelling: candidate
jsoref Aug 28, 2025
2d1b39a
spelling: cannot
jsoref Sep 1, 2025
9d6eca3
spelling: case-insensitive
jsoref Sep 1, 2025
9be0505
spelling: character
jsoref Aug 28, 2025
5fdc6ad
spelling: charmap
jsoref Aug 28, 2025
09cd20b
spelling: chars map contains
jsoref Aug 31, 2025
6011037
spelling: classifier
jsoref Aug 28, 2025
c70e9d0
spelling: coefficient
jsoref Aug 28, 2025
e2f685d
spelling: communicating
jsoref Aug 28, 2025
790fd3b
spelling: comparison
jsoref Aug 28, 2025
507967d
spelling: completely
jsoref Aug 28, 2025
184cdc8
spelling: compute
jsoref Aug 28, 2025
825aaaf
spelling: concatenate
jsoref Aug 28, 2025
7e90eb4
spelling: conflicts
jsoref Aug 28, 2025
f5cc0f8
spelling: contiguous
jsoref Aug 28, 2025
8e9bb53
spelling: counter-intuitive
jsoref Sep 1, 2025
700ed53
spelling: damerau
jsoref Aug 28, 2025
e2f2e51
spelling: declarations
jsoref Aug 28, 2025
2102c26
spelling: default
jsoref Aug 28, 2025
a5933f7
spelling: defined
jsoref Aug 28, 2025
e303912
spelling: delimited
jsoref Aug 28, 2025
5569915
spelling: dependent
jsoref Aug 28, 2025
bef1f4b
spelling: depending
jsoref Aug 28, 2025
a12123a
spelling: deserializing
jsoref Aug 28, 2025
5da6a2a
spelling: development
jsoref Aug 28, 2025
3798e5e
spelling: diagonal
jsoref Aug 28, 2025
f1f32cf
spelling: dictionary
jsoref Aug 28, 2025
c112ef0
spelling: different
jsoref Aug 28, 2025
f5ecf1d
spelling: dimension
jsoref Aug 28, 2025
e75ddf2
spelling: discrete
jsoref Aug 28, 2025
79524af
spelling: download
jsoref Aug 28, 2025
609c24f
spelling: duplicated
jsoref Aug 28, 2025
7557999
spelling: efficient
jsoref Aug 28, 2025
9aadf1c
spelling: embedding
jsoref Aug 28, 2025
e62418b
spelling: empty
jsoref Aug 28, 2025
f3a580c
spelling: enabled
jsoref Aug 28, 2025
83cbf89
spelling: entities
jsoref Aug 28, 2025
e32448f
spelling: entity
jsoref Aug 28, 2025
bec3678
spelling: entry
jsoref Aug 28, 2025
818dd86
spelling: environment
jsoref Aug 28, 2025
d22fe52
spelling: examples
jsoref Aug 28, 2025
a734fdb
spelling: exceeds
jsoref Aug 28, 2025
e78fc5f
spelling: exists
jsoref Aug 28, 2025
3c59728
spelling: expectations
jsoref Aug 28, 2025
740f811
spelling: fall back
jsoref Sep 1, 2025
14c19a4
spelling: fine-tune
jsoref Sep 1, 2025
d6ea6fd
spelling: flattened
jsoref Aug 28, 2025
67f1370
spelling: frequency
jsoref Aug 28, 2025
1878c68
spelling: fullwidth
jsoref Aug 28, 2025
0fc93cb
spelling: fundamental
jsoref Aug 28, 2025
4b98012
spelling: future
jsoref Aug 28, 2025
c6a61cb
spelling: github
jsoref Aug 31, 2025
4b34b2e
spelling: id
jsoref Aug 31, 2025
6128941
spelling: imbalanced
jsoref Aug 28, 2025
52934a3
spelling: indexes
jsoref Aug 28, 2025
1cac977
spelling: initializes
jsoref Sep 1, 2025
c76076c
spelling: instance
jsoref Aug 28, 2025
d3259f8
spelling: instantiate
jsoref Aug 28, 2025
60c675f
spelling: intent
jsoref Aug 28, 2025
2f8f0c2
spelling: interval
jsoref Aug 28, 2025
72dc1ac
spelling: japanese
jsoref Aug 28, 2025
30ed163
spelling: language
jsoref Aug 28, 2025
7fd987b
spelling: levenshtein
jsoref Aug 28, 2025
8b30531
spelling: libraries
jsoref Aug 28, 2025
a0a9f59
spelling: logger
jsoref Aug 28, 2025
23a5823
spelling: longer
jsoref Aug 31, 2025
11c26e1
spelling: manipulating
jsoref Aug 28, 2025
538808c
spelling: manually
jsoref Aug 28, 2025
f075913
spelling: mapping
jsoref Aug 31, 2025
0681d8d
spelling: multi
jsoref Aug 29, 2025
9fbd0ae
spelling: nonexistent
jsoref Aug 31, 2025
a54514a
spelling: normalization
jsoref Aug 29, 2025
1b4fe28
spelling: normalize
jsoref Aug 29, 2025
9e4354b
spelling: occurred
jsoref Aug 29, 2025
82e0847
spelling: occurrence
jsoref Aug 29, 2025
e4729d0
spelling: occurring
jsoref Aug 29, 2025
985e0a4
spelling: once
jsoref Aug 31, 2025
1a54524
spelling: one class
jsoref Aug 31, 2025
93bdfd1
spelling: one
jsoref Sep 1, 2025
ac87932
spelling: optional
jsoref Aug 29, 2025
ddc1654
spelling: outer
jsoref Aug 29, 2025
2173aa6
spelling: output
jsoref Aug 29, 2025
7dbf4c3
spelling: pairwise
jsoref Aug 29, 2025
1ab6ee7
spelling: pending
jsoref Aug 29, 2025
aa43465
spelling: platform
jsoref Aug 29, 2025
74a8003
spelling: pointer
jsoref Aug 29, 2025
8dca91c
spelling: position
jsoref Aug 29, 2025
093d38d
spelling: powerbook
jsoref Aug 29, 2025
fd777b5
spelling: precisely
jsoref Aug 29, 2025
8c80b5b
spelling: previous
jsoref Aug 29, 2025
0a46ae5
spelling: printf
jsoref Aug 31, 2025
34e68de
spelling: probabilistic
jsoref Aug 29, 2025
55fb216
spelling: probability
jsoref Aug 29, 2025
8d55b95
spelling: process
jsoref Aug 29, 2025
99754f6
spelling: progress
jsoref Aug 29, 2025
5b7501c
spelling: proposed
jsoref Aug 29, 2025
24d390d
spelling: punctuation
jsoref Aug 29, 2025
10408ef
spelling: redundant
jsoref Aug 29, 2025
8b3e3e1
spelling: remember
jsoref Aug 29, 2025
f5880ff
spelling: remotely
jsoref Aug 29, 2025
99fd4c1
spelling: representing
jsoref Aug 29, 2025
7aed059
spelling: requirement
jsoref Aug 29, 2025
637a224
spelling: resource
jsoref Aug 29, 2025
095af18
spelling: response
jsoref Aug 29, 2025
09c57b2
spelling: responsible
jsoref Aug 29, 2025
0c536a8
spelling: retrieve
jsoref Aug 29, 2025
4c91d0f
spelling: secondly
jsoref Aug 29, 2025
45fb98f
spelling: sentencepieces
jsoref Aug 29, 2025
d8c168b
spelling: sentences
jsoref Aug 29, 2025
e7194c7
spelling: several
jsoref Aug 29, 2025
c7e1ced
spelling: shorttype
jsoref Aug 29, 2025
50fb15d
spelling: should
jsoref Aug 29, 2025
1953428
spelling: standard
jsoref Aug 29, 2025
9912046
spelling: store
jsoref Aug 31, 2025
b347816
spelling: stratified
jsoref Aug 29, 2025
8f4bb17
spelling: stratify
jsoref Aug 29, 2025
bd2f299
spelling: successful
jsoref Aug 29, 2025
3f0d21b
spelling: suffix
jsoref Aug 31, 2025
4427eec
spelling: tablize
jsoref Aug 29, 2025
32597bd
spelling: testament
jsoref Aug 29, 2025
978f2c0
spelling: this
jsoref Aug 31, 2025
dca7fbe
spelling: three
jsoref Sep 1, 2025
890d466
spelling: threshold
jsoref Aug 29, 2025
feb6af2
spelling: timevalues
jsoref Sep 1, 2025
bda0905
spelling: training
jsoref Aug 31, 2025
e43b640
spelling: two
jsoref Aug 31, 2025
cee897e
spelling: unconstrained
jsoref Aug 29, 2025
8bb8603
spelling: unfortunately
jsoref Aug 29, 2025
2eb1dce
spelling: unknown
jsoref Aug 29, 2025
2b33aca
spelling: unnecessary
jsoref Aug 29, 2025
22f4a38
spelling: unshallow
jsoref Aug 29, 2025
507571f
spelling: unsuccessful
jsoref Aug 29, 2025
4084b2a
spelling: unsupported
jsoref Aug 31, 2025
5f018ff
spelling: untrimmed
jsoref Aug 29, 2025
194a576
spelling: upon
jsoref Aug 31, 2025
8720a4c
spelling: useful
jsoref Aug 29, 2025
5688d07
spelling: utilities
jsoref Aug 29, 2025
741ed24
spelling: version
jsoref Aug 29, 2025
c43399f
spelling: was
jsoref Aug 28, 2025
f5e83f4
spelling: whether
jsoref Aug 29, 2025
0fddac7
spelling: whitespace
jsoref Aug 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Git Unshalow
- name: Git Unshallow
run: git fetch --prune --unshallow
- name: Fetch Node Packages
run: |
Expand Down
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- **nlu-engine:** stop progress watchdog when done or error ([#214](https://github.com/botpress/nlu/issues/214)) ([0661abd](https://github.com/botpress/nlu/commit/0661abd043c22f03381f77561020de64d78b15bc))
- **nlu-server:** ensure forward slashes in app id wont break fs model repo ([#173](https://github.com/botpress/nlu/issues/173)) ([889aa7c](https://github.com/botpress/nlu/commit/889aa7c447f1647d9da1483d5157fc279d543c63))
- **nlu-server:** fix send training_time using db config ([6225ef1](https://github.com/botpress/nlu/commit/6225ef124ecc719385afe667f5904885404f6418))
- no more dupplicated issues in in-mem linting repo ([46cc134](https://github.com/botpress/nlu/commit/46cc13464b4aeaf51289a7f30f1992c377341b47))
- no more duplicated issues in in-mem linting repo ([46cc134](https://github.com/botpress/nlu/commit/46cc13464b4aeaf51289a7f30f1992c377341b47))
- **worker:** do not reuse a process if it exited since last usage ([#135](https://github.com/botpress/nlu/issues/135)) ([9c3ab74](https://github.com/botpress/nlu/commit/9c3ab74c1c798fccd5e52e87bda9c4a34ac3d6b2))

### Features
Expand Down Expand Up @@ -141,7 +141,7 @@
- **lint:** applied linting to code ([774d32c](https://github.com/botpress/nlu/commit/774d32c4f5b414ebd4d22cbd8b4de027feee5f62))
- **sentry:** use sentry enabled instead of DSN for the configuration ([e89301c](https://github.com/botpress/nlu/commit/e89301cb5d633b6ba9649bb0d9164235885e9308))
- **style:** fix codestyle for tests, lint & formatting ([c9c572a](https://github.com/botpress/nlu/commit/c9c572a76110c6c54ef8a60bd727ae33e65eb018))
- **worker:** fix node typings to pass environement variables correctly when spawning new thread ([#76](https://github.com/botpress/nlu/issues/76)) ([853a3f3](https://github.com/botpress/nlu/commit/853a3f3d7de38471cf4539dc395c6bf7b8ee9a27))
- **worker:** fix node typings to pass environment variables correctly when spawning new thread ([#76](https://github.com/botpress/nlu/issues/76)) ([853a3f3](https://github.com/botpress/nlu/commit/853a3f3d7de38471cf4539dc395c6bf7b8ee9a27))
- run unit tests of all yarn packages from the root ([26670d3](https://github.com/botpress/nlu/commit/26670d30de797f3fa8c95b55330270157a79f1d1))
- **style:** fix codestyle for tests, lint & formatting ([cacbf94](https://github.com/botpress/nlu/commit/cacbf948a5f8589ce5bfd6402d3578b48c816497))
- undefined logger in slot tagger ([b2c688d](https://github.com/botpress/nlu/commit/b2c688dbef69fbda677adc701a23843f47504499))
Expand All @@ -157,7 +157,7 @@
### Bug Fixes

- exact matcher now works even with different entities ([#56](https://github.com/botpress/nlu/issues/56)) ([6c14b8c](https://github.com/botpress/nlu/commit/6c14b8ce6b14398fcdc621455382c0e18aaa0570))
- **training:** porgress now won't skip steps ([#55](https://github.com/botpress/nlu/issues/55)) ([4073d61](https://github.com/botpress/nlu/commit/4073d617edf19d683833ee8394ead2376c94fdfa))
- **training:** progress now won't skip steps ([#55](https://github.com/botpress/nlu/issues/55)) ([4073d61](https://github.com/botpress/nlu/commit/4073d617edf19d683833ee8394ead2376c94fdfa))

### Features

Expand Down Expand Up @@ -221,7 +221,7 @@
- **api:** no need for min 1 context ([e17ae84](https://github.com/botpress/nlu/commit/e17ae84df4d9d1c9d2102ecf3c470547bcf35147))
- **engine:** spell-checker does not replace entities anymore ([0e0d75a](https://github.com/botpress/nlu/commit/0e0d75a8efa2bb00d9b5c3c08f5873cc66425251))
- **logger:** no log filter should log all messages ([86e693c](https://github.com/botpress/nlu/commit/86e693c579e5a2a88648dc9810f55821db69b00d))
- logger attach error no longuer throws ([b84f39a](https://github.com/botpress/nlu/commit/b84f39abd6eea9f8bdd56ec1dbaf5dad5a5e75d4))
- logger attach error no longer throws ([b84f39a](https://github.com/botpress/nlu/commit/b84f39abd6eea9f8bdd56ec1dbaf5dad5a5e75d4))
- nanoid is default import from nanoid ([45ca517](https://github.com/botpress/nlu/commit/45ca517250002b230f455049a409867b60cc8836))

### Features
Expand Down
2 changes: 1 addition & 1 deletion packages/bitfan/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ interface Engine<T extends ProblemType> {
}
```

The `Criteria` abstraction act as a decision function that decides weither or not the test is failing or passing. It exists because engines are not responsible for electing a label.
The `Criteria` abstraction act as a decision function that decides whether or not the test is failing or passing. It exists because engines are not responsible for electing a label.

```ts
interface Criteria<T extends ProblemType> {
Expand Down
8 changes: 4 additions & 4 deletions packages/bitfan/src/bitfan.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export namespace sampling {
dataset: DataSet<T>,
trainPercent: number,
seed: number,
options?: { stratificate: boolean }
options?: { stratify: boolean }
) => {
trainSet: DataSet<T>
testSet: DataSet<T>
Expand All @@ -105,7 +105,7 @@ export namespace sampling {
dataset: DataSet<T>,
percent: number,
seed: number,
options?: { stratificate: boolean }
options?: { stratify: boolean }
) => DataSet<T>

export const sampleClasses: <T extends SingleLabel>(
Expand All @@ -132,7 +132,7 @@ export namespace labels {
}

export namespace tables {
export const tabelize: <D>(
export const tablize: <D>(
data: D[],
disposition: {
row: (d: D) => string
Expand Down Expand Up @@ -249,7 +249,7 @@ export type Prediction<T extends ProblemType> = {
}

/**
* @description Function that decides weither or not a test should pass or fail.
* @description Function that decides whether or not a test should pass or fail.
* @returns A number between 0 and 1 where 0 means that the test has failed.
* For multi-class problems, this number will often be, neither 1 or 0, but a fraction.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/bitfan/src/builtin/sampling/samplesClasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const sampleClasses: typeof sdk.sampling.sampleClasses = <T extends sdk.S
.value()

if (nClass < 0) {
throw new Error(`Can't subsample a negative ammount of classes (${nClass}).`)
throw new Error(`Can't subsample a negative amount of classes (${nClass}).`)
}
if (nClass > allClasses.length) {
throw new Error(`Can't subsample ${nClass} classes out of ${allClasses.length} class.`)
Expand Down
6 changes: 3 additions & 3 deletions packages/bitfan/src/builtin/sampling/trainTestSplit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const subSample: typeof sampling.subSample = <T extends ProblemType>(
dataset: DataSet<T>,
percent: number,
seed: number,
options = { stratificate: true }
options = { stratify: true }
): DataSet<T> => {
const { trainSet } = trainTestSplit(dataset, percent, seed, options)
return trainSet
Expand All @@ -17,7 +17,7 @@ export const trainTestSplit: typeof sampling.trainTestSplit = <T extends Problem
dataset: DataSet<T>,
trainPercent: number,
seed: number,
options = { stratificate: true }
options = { stratify: true }
): {
trainSet: DataSet<T>
testSet: DataSet<T>
Expand All @@ -39,7 +39,7 @@ export const trainTestSplit: typeof sampling.trainTestSplit = <T extends Problem
const trainSamples: Sample<T>[] = []
const testSamples: Sample<T>[] = []

if (options.stratificate) {
if (options.stratify) {
// preserve proportions of each class
for (const c of allClasses) {
const samplesOfClass = dataset.samples.filter((r) => areSame(r.label, c))
Expand Down
2 changes: 1 addition & 1 deletion packages/bitfan/src/builtin/tables/init.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { initDic } from './init'

test('initDictionnary', () => {
test('initDictionary', () => {
// arrange

// act
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as sdk from '../../bitfan'
import { tabelize } from './tabelize'
import { tablize } from './tablize'

test('toTable', () => {
// arrange
Expand All @@ -14,7 +14,7 @@ test('toTable', () => {
}

// act
const table = tabelize(performanceReport.scores, {
const table = tablize(performanceReport.scores, {
row: (d) => d.metric,
column: (d) => `${d.seed}`,
score: (d) => d.score
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as sdk from 'bitfan/sdk'
import _ from 'lodash'
import { initTable } from './init'

export const tabelize: typeof sdk.tables.tabelize = <D>(
export const tablize: typeof sdk.tables.tablize = <D>(
data: D[],
disposition: {
row: (d: D) => string
Expand Down
4 changes: 2 additions & 2 deletions packages/bitfan/src/builtin/visualisation/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as sdk from 'bitfan/sdk'
import chalk from 'chalk'
import _ from 'lodash'
import { roundTable } from '../tables/round'
import { tabelize } from '../tables/tabelize'
import { tablize } from '../tables/tablize'

const DEFAULT_OPT: {
groupBy: 'seed' | 'problem' | 'all'
Expand All @@ -18,7 +18,7 @@ export const showPerformanceReport: typeof sdk.visualisation.showPerformanceRepo
) => {
const options = { ...DEFAULT_OPT, ...(opt ?? {}) }

let table = tabelize(report.scores, {
let table = tablize(report.scores, {
row: (s) => s.metric,
column: (s) => (options.groupBy === 'seed' ? `${s.seed}` : options.groupBy === 'problem' ? s.problem : 'all'),
score: (s) => s.score
Expand Down
4 changes: 2 additions & 2 deletions packages/bitfan/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { trainTestSplit, subSample } from './builtin/sampling/trainTestSplit'
import { isAllDefined } from './builtin/tables/guards'
import { initDic, initTable } from './builtin/tables/init'
import { roundDic, roundTable } from './builtin/tables/round'
import { tabelize } from './builtin/tables/tabelize'
import { tablize } from './builtin/tables/tablize'
import { transposeTable } from './builtin/tables/transpose'
import { showClassDistribution, showDatasetsSummary } from './builtin/visualisation/dataset'
import { showOOSConfusion } from './builtin/visualisation/oos'
Expand Down Expand Up @@ -104,7 +104,7 @@ const impl: typeof sdk = {
},

tables: {
tabelize,
tablize,
initDic,
initTable,
roundDic,
Expand Down
2 changes: 1 addition & 1 deletion packages/bitfan/src/services/bp-provider/stan-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class StanProvider {
public async predict(utterances: string[]): Promise<PredictOutput[]> {
const predOutput = await this._client.predict(APP_ID, this._modelId ?? '', { utterances })
if (!predOutput.success) {
throw new Error(`An error occured at prediction: ${predOutput.error.message}.`)
throw new Error(`An error occurred at prediction: ${predOutput.error.message}.`)
}
return predOutput.predictions
}
Expand Down
2 changes: 1 addition & 1 deletion packages/bitfan/src/solution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const makeSolutionRunner = <T extends sdk.ProblemType>(
// eslint-disable-next-line no-console
console.log(
chalk.red(
`The following error occured when solving problem ${problem.name} with seed ${seed}:\n${err.message}\n${err.stack}`
`The following error occurred when solving problem ${problem.name} with seed ${seed}:\n${err.message}\n${err.stack}`
)
)
process.exit(1)
Expand Down
4 changes: 2 additions & 2 deletions packages/distributed/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Locks prevent multiple types of race conditions. Race conditions can occur:

- in single-threaded apps when using asynchronous code
- in multi-threaded/multi-process apps
- in mutli-instances apps
- in multi-instances apps

## Queues

A Distributed Task Queue can run tasks on multiple instances without the need for a master slave configuration.

## Licensing

This software is protected by the same license as the [main Botpress repository](https://github.com/botpress/botpress). You can find the license file [here](https://github.com/botpress/botpress/blob/master/LICENSE).
This software is protected by the same [license](https://github.com/botpress/botpress/blob/master/LICENSE) as the [main Botpress repository](https://github.com/botpress/botpress).
2 changes: 1 addition & 1 deletion packages/distributed/src/locks/in-mem-trx-locker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import _ from 'lodash'
import { TransactionLocker, Logger, Transaction } from './typings'

/**
* For race conditions occuring because of the event loop in a single-threaded application
* For race conditions occurring because of the event loop in a single-threaded application
*/
export class InMemoryTransactionLocker<T> implements TransactionLocker<T> {
private _tasks: Transaction<void>[] = []
Expand Down
2 changes: 1 addition & 1 deletion packages/distributed/src/locks/pg-trx-locker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TransactionLocker, Transaction, Logger } from './typings'
const TRX_LOCK_KEY = 'trx_lock'

/**
* For race conditions occuring in distributed applications
* For race conditions occurring in distributed applications
*/
export class PGTransactionLocker<T> implements TransactionLocker<T> {
private client: Client
Expand Down
6 changes: 3 additions & 3 deletions packages/distributed/src/locks/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export type Transaction<T> = {
* Prevents race conditions by only running one task at a time.
* Tasks are simply called when its there turn to run.
*
* Does not involve to mannualy check if lock is free.
* Does not involve to manually check if lock is free.
*/
export type TransactionLocker<T> = {
/**
* Waits for a lock to be free, aquires it and runs function
* @param t The async function to run inside the aquire and release lock statement
* Waits for a lock to be free, acquires it and runs function
* @param t The async function to run inside the acquire and release lock statement
* @returns A promise that resolves of rejects once the task is done or throws
*/
runInLock(t: Transaction<T>): Promise<T>
Expand Down
8 changes: 4 additions & 4 deletions packages/distributed/src/queues/base-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export abstract class BaseTaskQueue<TId, TInput, TData, TError> implements ITask
return this._schedulingTimmer.run()
} catch (thrown) {
const err = thrown instanceof Error ? thrown : new Error(`${thrown}`)
this._logger.attachError(err).error('An error occured when running scheduler interrupt.')
this._logger.attachError(err).error('An error occurred when running scheduler interrupt.')
}
}

Expand All @@ -92,12 +92,12 @@ export abstract class BaseTaskQueue<TId, TInput, TData, TError> implements ITask
return
}

const pendings = await repo.query({ status: 'pending' })
if (pendings.length <= 0) {
const pending = await repo.query({ status: 'pending' })
if (pending.length <= 0) {
return
}

const task = pendings[0]
const task = pending[0]
task.status = 'running'
task.cluster = this._clusterId
await repo.set(task)
Expand Down
4 changes: 2 additions & 2 deletions packages/distributed/src/queues/interrupt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export type InterruptTimer<X extends any[]> = {
*
* Basically the opposite of a throttle.
* Ensures a function is executed at least every x ms.
* Running the function mannualy only resets the timmer.
* Running the function manually only resets the timmer.
*
* @param f Function to run
* @param ms Max allowed time beetween function invocation
* @param ms Max allowed time between function invocation
* @returns a timer object that can be ran or stopped
*/
export const createTimer = <X extends any[]>(f: Func<X, Promise<void>>, ms: number): InterruptTimer<X> => {
Expand Down
4 changes: 2 additions & 2 deletions packages/distributed/src/queues/pg-distributed-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class PGDistributedTaskQueue<TId, TInput, TData, TError>

private _handleCancelTaskEvent = async (taskId: TId, clusterId: string) => {
if (clusterId !== this._clusterId) {
return // message was not adressed to this instance
return // message was not addressed to this instance
}

try {
Expand All @@ -117,7 +117,7 @@ export class PGDistributedTaskQueue<TId, TInput, TData, TError>
}
}

// for if an completly busy instance receives a queue task http call
// for if a completely busy instance receives a queue task http call
protected runSchedulerInterrupt() {
return this._obs.emit('run_scheduler_interrupt', undefined)
}
Expand Down
Loading