var Sequelize = require('sequelize');
var sequelize = new Sequelize('mysql://XXX');
var request = require('request');
var id = 1;
var r = null;
var User = sequelize.define('user', {
info: {
type: Sequelize.TEXT,
},
uuid: {
type: Sequelize.UUID,
defaultValue: Sequelize.UUIDV4
}
}, {
freezeTableName: true // Model tableName will be the same as the model name
});
setInterval(function () {
r = request.get('http://www.mysite.com?mid=' + (id++), function(err, data) {
if (data && data.body) {
User.create({
info: data.body
}).then(function() {
console.log(id + 'ok');
});
}
});
}, 500);
是不是写错了什么地方导致了资源没有释放?
I also have this problem, setInterval keeps executing the data from the request, causing the memory to skyrocket
Profile tool to see which object has not been released