Skip to content

Commit

Permalink
Make no worky
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Clayton committed Aug 14, 2017
1 parent e9b1253 commit 06bc504
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions api/controllers/TestController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let sails = require('sails')

module.exports = {
test: (req, res) => res.send(Object.keys(sails.models))
}
7 changes: 7 additions & 0 deletions api/models/Test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
attributes: {
name: {
type: 'string'
}
}
}
4 changes: 4 additions & 0 deletions api/services/Test1Service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
Commenting out test2 makes it work
*/
let test2 = require('./Test2Service')
1 change: 1 addition & 0 deletions api/services/Test2Service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let sails = require('sails')

This comment has been minimized.

Copy link
@mikermcneil

mikermcneil Aug 15, 2017

I suspect that if you use the global instead of require('sails'), it would solve the problem here. Alternatively, if you'd rather use require('sails'), I think if you moved it inside your function(s) in the place(s) where you need it, it should avoid the race condition during load.

We're still looking into this regardless to see if we can make the behavior nicer-- thanks for the heads up!

2 changes: 1 addition & 1 deletion config/blueprints.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports.blueprints = {
* *
***************************************************************************/

// actions: false,
actions: true,


/***************************************************************************
Expand Down

0 comments on commit 06bc504

Please sign in to comment.