Skip to content

Commit

Permalink
Merge pull request #141 from bhsiao123/patch/typescript
Browse files Browse the repository at this point in the history
Add missing JobMonitorOptions to ConstructorOptions
  • Loading branch information
timgit committed Feb 1, 2020
2 parents 4e6026b + 87d92a8 commit d5e9e11
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pg-boss can be customized using configuration options when an instance is create

- [Constructor Options](#constructor-options)
- [Database options](#database-options)
- [Job monitor options](#job-monitor-options)
- [Job creation options](#job-creation-options)
- [Job fetch options](#job-fetch-options)
- [Job expiration options](#job-expiration-options)
Expand Down Expand Up @@ -77,6 +78,8 @@ Since passing only a connection string is intended to be for convenience, you ca

Only alphanumeric and underscore allowed, length: <= 50 characters

### Job monitor options

* **monitorStateIntervalSeconds** - int, default undefined

Specifies how often in seconds an instance will fire the `monitor-states` event. Cannot be less than 1.
Expand Down
14 changes: 13 additions & 1 deletion types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ declare namespace PgBoss {
db?: Db;
}

interface JobMonitorOptions {
/**
* Specifies how often in seconds an instance will fire the monitor-states event. Cannot be less than 1.
*/
monitorStateIntervalSeconds?: number

/**
* Specifies how often in minutes an instance will fire the monitor-states event. Cannot be less than 1. Do not use if using monitorStateIntervalSeconds
*/
monitorStateIntervalMinutes?: number
}

interface JobCreationOptions {
uuid?: "v1" | "v4";
}
Expand All @@ -44,7 +56,7 @@ declare namespace PgBoss {
deleteCheckInterval?: number;
}

type ConstructorOptions = DatabaseOptions & JobCreationOptions & JobFetchOptions & JobExpirationOptions & JobArchiveOptions;
type ConstructorOptions = DatabaseOptions & JobMonitorOptions & JobCreationOptions & JobFetchOptions & JobExpirationOptions & JobArchiveOptions;

interface PublishOptions {
priority?: number;
Expand Down

0 comments on commit d5e9e11

Please sign in to comment.