Skip to content

Commit

Permalink
Merge pull request #24 from TNG/remove-typeorm
Browse files Browse the repository at this point in the history
Remove typeorm and update mongodb
  • Loading branch information
NiklasEi authored Sep 6, 2021
2 parents b174641 + fd29c3c commit c4378e8
Show file tree
Hide file tree
Showing 51 changed files with 1,171 additions and 1,472 deletions.
9 changes: 1 addition & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ module.exports = {
project: 'tsconfig.eslint.json',
sourceType: 'module',
},
plugins: [
'@typescript-eslint',
'eslint-plugin-import',
'eslint-plugin-jsdoc',
'eslint-plugin-prefer-arrow',
'sort-imports-es6-autofix',
],
plugins: ['@typescript-eslint', 'eslint-plugin-import', 'eslint-plugin-jsdoc', 'eslint-plugin-prefer-arrow'],
rules: {
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/array-type': [
Expand Down Expand Up @@ -192,7 +186,6 @@ module.exports = {
radix: 'error',
semi: 'off', // use @typescript-eslint/semi instead
'sort-imports': ['error', { allowSeparatedGroups: true, ignoreDeclarationSort: true }],
'sort-imports-es6-autofix/sort-imports-es6': 'error',
'space-before-function-paren': 'off',
'space-in-parens': ['error', 'never'],
'spaced-comment': [
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,3 @@ jobs:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm run test
- run: npm run test:integration
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ If the parameter is omitted, all jobs are started/stopped/cancelled/removed.
| removeJob | `string` | Stops and removes the job with the provided name (if on the schedule) from both the schedule and the database. |
| count | `boolean` (optional) | Returns the number of jobs on the schedule. Only started jobs are counted if parameter is set to true. |
| list | | Returns descriptions of all jobs on the schedule. |
| check | `string` | Returns execution information of the job with the provided name from the database. This also works if the job is not on the schedule. |
| clear | | Removes all jobs from the database. This also removes jobs that are not on this schedule, but were defined by other schedules. However, does NOT stop job executions - this will cause currently running jobs to fail. Consider using stop/cancel/remove methods instead! |
| get | `string` | Returns a description of the job. Returns undefined if no job with the provided name is defined. |
| run | `string` | Runs the job with the provided name once, immediately. Note that `maxRunning` is respected, ie. the execution is skipped if the job is already running `maxRunning` times. |
| on | `'debug'` or `'error'`, `function` | Define a callback for debug or error events. |
Expand Down Expand Up @@ -103,18 +105,6 @@ mongoSchedule.on('debug', ({ data, message }: MomoEvent) => {
| error | type | `MomoErrorType` | `'defining job failed'` or `'scheduling job failed'` or `'executing job failed'` or `'stopping job failed'` |
| error | error (optional) | `Error` | The root cause of the error. |

### Other functions

momo-scheduler also includes some utility functions to retrieve information on momo jobs from its database:

| function | parameter | description |
|---------------|-----------|-------------|
| `connect` | `{ url: string }` | Establishes a connection with MongoDB. If you want to schedule jobs, you should use `MongoSchedule.connect` instead to create a connected schedule. |
| `isConnected` | | Returns true if a connection to MongoDB was established and false otherwise. |
| `check` | `string` | Retrieves information on the last job execution. Returns undefined if job cannot be found or was never executed. |
| `list` | | Lists all jobs. |
| `clear` | | Removes all jobs from the database. Do not use this if MongoSchedule has already been started. Subsequent execution of all jobs will fail! |

## License

This project is open source and licensed under [Apache 2.0](LICENSE).
Expand Down
Loading

0 comments on commit c4378e8

Please sign in to comment.