-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📦 NEW: [BREAKING] Support localStorage to run task (#58)
- Drop Node.js <= 14 support
- Loading branch information
Showing
17 changed files
with
160 additions
and
70 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
test/fixtures/subscription-enableFastContextLogger/app/schedule/interval.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const Subscription = require('egg').Subscription; | ||
|
||
class Interval extends Subscription { | ||
static get schedule() { | ||
return { | ||
type: 'worker', | ||
interval: 4000, | ||
}; | ||
} | ||
|
||
* subscribe() { | ||
this.app.logger.info('interval'); | ||
} | ||
} | ||
|
||
module.exports = Interval; |
16 changes: 16 additions & 0 deletions
16
test/fixtures/subscription-enableFastContextLogger/app/schedule/sub/cron.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const Subscription = require('egg').Subscription; | ||
|
||
class Interval extends Subscription { | ||
static get schedule() { | ||
return { | ||
type: 'worker', | ||
cron: '*/5 * * * * *', | ||
}; | ||
} | ||
|
||
* subscribe() { | ||
this.app.logger.info('cron'); | ||
} | ||
} | ||
|
||
module.exports = Interval; |
3 changes: 3 additions & 0 deletions
3
test/fixtures/subscription-enableFastContextLogger/config/config.default.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
exports.logger = { | ||
enableFastContextLogger: true, | ||
}; |
5 changes: 5 additions & 0 deletions
5
test/fixtures/subscription-enableFastContextLogger/config/plugin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
exports.logrotator = true; | ||
exports.tracer = { | ||
enable: true, | ||
package: 'egg-tracer', | ||
}; |
3 changes: 3 additions & 0 deletions
3
test/fixtures/subscription-enableFastContextLogger/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "subscription-enableFastContextLogger" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
exports.schedule = { | ||
type: 'worker', | ||
interval: '4s', | ||
}; | ||
|
||
exports.task = async ctx => { | ||
ctx.app.logger.info('interval'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
exports.schedule = { | ||
type: 'worker', | ||
cron: '*/5 * * * * *', | ||
}; | ||
|
||
exports.task = async (ctx, ...args) => { | ||
ctx.app.logger.info('foobar', ...args); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exports.logrotator = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "worker2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters