Skip to content

Commit

Permalink
perf(core): memory fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed May 23, 2019
1 parent de17ba9 commit e320e83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cache/tagStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var ticketSchema = require('../models/ticket')
var init = function (tickets, timespan, callback) {
var tags = []
var $tickets = []
if (_.isUndefined(timespan) || _.isNaN(timespan) || timespan === 0) timespan = 99999
if (_.isUndefined(timespan) || _.isNaN(timespan) || timespan === 0) timespan = 365

var today = moment()
.hour(23)
Expand Down Expand Up @@ -89,6 +89,8 @@ var init = function (tickets, timespan, callback) {
}).reverse()
)

t = null

return done()
}
],
Expand Down
3 changes: 3 additions & 0 deletions src/cache/ticketStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ function buildGraphData (arr, days, callback) {
obj.date = d.format('YYYY-MM-DD')

obj.value = counted[obj.date] === undefined ? 0 : counted[obj.date]

graphData.push(obj)
}

counted = null

return callback(graphData)
}

Expand Down

0 comments on commit e320e83

Please sign in to comment.