Skip to content

Commit

Permalink
fix(bpmn-service): fix multiple workflow worker registration issue (#268
Browse files Browse the repository at this point in the history
)

* fix(bpmn-service): fix single workflow registration issue

GH-267
  • Loading branch information
akshatdubeysf authored Jul 19, 2021
1 parent cb60fd5 commit a29493c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
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?.[workflowName]) {
if (!workerMap) {
workerMap = {};
}
if (workerMap[workflowName]) {
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)

0 comments on commit a29493c

Please sign in to comment.