Skip to content

Commit

Permalink
Merge pull request #7 from fabrix-app/v1.1
Browse files Browse the repository at this point in the history
[fix] cron allowedMethods
  • Loading branch information
scott-wyatt authored Aug 29, 2018
2 parents 4e85e64 + d54586d commit 357a7ad
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ jobs:
- run:
name: install-npm-wee
command: npm install
- run:
name: install-npm-sqlite
command: npm install [email protected]
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
Expand Down
18 changes: 11 additions & 7 deletions lib/Cron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ const CronProxyHandler = {
get (target, key, args) {
// Methods that extend the Cron Class
const allowedMethods = target.methods ? target.methods : []
// Methods that are reserved
const unallowedMethods = [
'cancel',
'cancelNext',
'freeze',
'findJobByName',
'nextInvocation',
'reschedule',
'unfreeze'
'unfreeze',
...target.unallowedMethods
]

if (
target.immutable === true
&& target.timeTilStart > 0
&& allowedMethods.indexOf(key) > -1
// Methods that are reserved
&& unallowedMethods.indexOf(key) === -1
) {
// Log to debug that the cron is being delayed
Expand All @@ -40,10 +40,14 @@ const CronProxyHandler = {
}

export class Cron {
app
scheduler
_uptime_delay
_uptime
public app
public scheduler
private _uptime_delay
private _uptime

private unallowedMethods: string[] = [

]

constructor (app: FabrixApp) {
Object.defineProperties(this, {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fabrix/spool-engine",
"version": "1.1.4",
"version": "1.1.5",
"description": "Spool - Emitter Engine for Fabrix",
"homepage": "https://fabrix.app",
"author": {
Expand Down

0 comments on commit 357a7ad

Please sign in to comment.