Skip to content

Commit 30932fc

Browse files
author
chenzheqi
committed
feat: customize load in agent or in app
1 parent cbc3a84 commit 30932fc

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

agent.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

33
module.exports = agent => {
4-
require('./lib/loader')(agent);
4+
if (agent.config.sequelize.agent) {
5+
require('./lib/loader')(agent);
6+
}
57
};

app.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
module.exports = app => {
4-
require('./lib/loader')(app);
4+
if (app.config.sequelize.app) {
5+
require('./lib/loader')(app);
6+
}
57
};
6-

config/config.default.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
exports.sequelize = {
4+
agent: false,
5+
app: true,
46
dialect: 'mysql',
57
database: '',
68
host: 'localhost',

0 commit comments

Comments
 (0)