Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bpmn-service): fix multiple workflow worker registration issue #268

Merged
merged 4 commits into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ export class WorkerRegisterFnProvider implements Provider<WorkerRegisterFn> {
value(): WorkerRegisterFn {
return async (workflowName, topic, command) => {
let workerMap = await this.workerMapGetter();
if (!workerMap) {
workerMap = {};
}
if (workerMap?.[workflowName]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this '?'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

workerMap[workflowName].push({topic, command, running: false});
} else {
workerMap = {
[workflowName]: [{topic, command, running: false}],
};
workerMap[workflowName] = [{topic, command, running: false}];
this.workerMapSetter(workerMap);
}
};
Expand Down
26 changes: 13 additions & 13 deletions services/notification-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ npm i @sourceloop/notification-service
- **Push Notifications with Pubnub** -
- Bind the Pubnub Config to the `PubNubProvider.Config` key -
``` typescript
this.bind(PubNubProvider.Config).to({
this.bind(PubnubBindings.Config).to({
subscribeKey: process.env.PUBNUB_SUBSCRIBE_KEY,
publishKey: process.env.PUBNUB_PUBLISH_KEY,
secretKey: process.env.PUBNUB_SECRET_KEY,
Expand Down Expand Up @@ -248,18 +248,18 @@ npm i @sourceloop/notification-service

### Environment Variables

| Name | Required | Default Value | Description |
| ------------- | -------- | ------------- | ------------------------------------------------------------ |
| `NODE_ENV` | Y | | Node environment value, i.e. `dev`, `test`, `prod` |
| `LOG_LEVEL` | Y | | Log level value, i.e. `error`, `warn`, `info`, `verbose`, `debug` |
| `DB_HOST` | Y | | Hostname for the database server. |
| `DB_PORT` | Y | | Port for the database server. |
| `DB_USER` | Y | | User for the database. |
| `DB_PASSWORD` | Y | | Password for the database user. |
| `DB_DATABASE` | Y | | Database to connect to on the database server. |
| Name | Required | Default Value | Description |
| ------------- | -------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `NODE_ENV` | Y | | Node environment value, i.e. `dev`, `test`, `prod` |
| `LOG_LEVEL` | Y | | Log level value, i.e. `error`, `warn`, `info`, `verbose`, `debug` |
| `DB_HOST` | Y | | Hostname for the database server. |
| `DB_PORT` | Y | | Port for the database server. |
| `DB_USER` | Y | | User for the database. |
| `DB_PASSWORD` | Y | | Password for the database user. |
| `DB_DATABASE` | Y | | Database to connect to on the database server. |
| `DB_SCHEMA` | Y | | Database schema used for the data source. In PostgreSQL, this will be `public` unless a schema is made explicitly for the service. |
| `JWT_SECRET` | Y | | Symmetric signing key of the JWT token. |
| `JWT_ISSUER` | Y | | Issuer of the JWT token. |
| `JWT_SECRET` | Y | | Symmetric signing key of the JWT token. |
| `JWT_ISSUER` | Y | | Issuer of the JWT token. |

### Setting up a `DataSource`

Expand Down Expand Up @@ -324,4 +324,4 @@ Authorization: Bearer <token> where <token> is a JWT token signed using JWT issu

## API's Details

Visit the [OpenAPI spec docs](./openapi.md)
Visit the [OpenAPI spec docs](./openapi.md)