我们正在上运行一个带有Cloud数据库的Sails.js API,最近我们发现我们的一些端点一直处于停滞状态,从未发送响应。
我有一个健康检查监测/v1/状态,当我有以下简单反应时,它记录了100%的正常运行时间;
status: function( req, res ){
res.ok('Welcome to the API');
}
一旦我们添加了数据库查询,端点就开始超时。它并不总是发生,但似乎是随机的间隔,有时是连续几个小时。这就是我们将查询更改为;
status: function( req, res ){
Email.findOne({
var obsType = (from lk in db.LookUp
join
lt in db.LookUpType
on
lk.LookUpTypeId equals lt.LookupTypeId
where (lt.FieldName == "OBSType")
&&
!(db.OBSSetti
请帮助我将我的问题描述为:( 1)用户实体
var User = Waterline.Collection.extend({
identity: 'user',
connection: 'local-postgresql',
attributes: {
firstName: 'string',
lastName: 'string',
// Add a reference to Pet
pet: {
model: 'pet'
}
}
});
2)宠物实体
var Pet = Waterline.Collec
newlyInsertedRecord in afterCreate(newlyInsertedRecord, cb) {}缺少所有实例方法。
1 /**
2 * Dog.js
3 *
4 * @description :: TODO: You might write a short summary of how this model works and what it represents here.
5 * @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/model
我有一个关于Sails Passport实现的问题。此错误出现在我的终端中:
/home/tatico/sinGualichoPassport/config/passport.js:19
if (!user.validPassword(password)) {
^
TypeError: user.validPassword is not a function
at /home/tatico/sinGualichoPassport/config/passport.js:19:17
at returnResults (/home/ta