Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nestjs/schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Jan 22, 2021
2 parents 0cdfe8f + d54c7ce commit e187fac
Show file tree
Hide file tree
Showing 11 changed files with 1,995 additions and 2,004 deletions.
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Expand Up @@ -186,7 +186,7 @@ Samples: (even more [samples](https://github.com/nestjs/nest/commits/master))
docs(changelog) update change log to beta.5
```
```
bugfix(@nestjs/core) need to depend on latest rxjs and zone.js
fix(@nestjs/core) need to depend on latest rxjs and zone.js
The version in our package.json gets copied to the one we publish, and users need the latest of these.
```
Expand All @@ -198,10 +198,11 @@ If the commit reverts a previous commit, it should begin with `revert: `, follow
Must be one of the following:

* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* **chore**: Updating tasks etc; no production code change
* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
* **docs**: Documentation only changes
* **feature**: A new feature
* **bugfix**: A bug fix
* **feat**: A new feature
* **fix**: A bug fix
* **perf**: A code change that improves performance
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
Expand Down
22 changes: 22 additions & 0 deletions LICENSE
@@ -0,0 +1,22 @@
(The MIT License)

Copyright (c) Kamil Mysliwiec

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 changes: 13 additions & 0 deletions lib/scheduler.registry.ts
Expand Up @@ -8,6 +8,19 @@ export class SchedulerRegistry {
private readonly timeouts = new Map<string, any>();
private readonly intervals = new Map<string, any>();

doesExists(type: 'cron' | 'timeout' | 'interval', name: string) {
switch (type) {
case 'cron':
return this.cronJobs.has(name);
case 'interval':
return this.intervals.has(name);
case 'timeout':
return this.timeouts.has(name);
default:
return false;
}
}

getCronJob(name: string) {
const ref = this.cronJobs.get(name);
if (!ref) {
Expand Down

0 comments on commit e187fac

Please sign in to comment.