Fixed timestamp not properly set when adding tasks from presets

This commit is contained in:
Zaid Abdulla committed 2013-04-12 17:19:03 +03:00
1 parent bf518a5e92
commit 9f156c2c88
1 file changed
+2 -3
+2 -3
View File
@@ -2,7 +2,6 @@ config = require './config'
common = require './common' common = require './common'
db = require './db' db = require './db'
mongoQuery = require './mongo-query' mongoQuery = require './mongo-query'
mongodb = require 'mongodb'
query = require './query' query = require './query'
@@ -90,9 +89,9 @@ exports.assertPresets = (deviceId, presetsHash, callback) ->
throw new Error('Unknown configuration type') throw new Error('Unknown configuration type')
if getParameterValues.length if getParameterValues.length
taskList.push {device : deviceId, name : 'getParameterValues', parameterNames: getParameterValues, timestamp : mongodb.Timestamp()} taskList.push {device : deviceId, name : 'getParameterValues', parameterNames: getParameterValues, timestamp : new Date()}
if setParameterValues.length if setParameterValues.length
taskList.push {device : deviceId, name : 'setParameterValues', parameterValues: setParameterValues, timestamp : mongodb.Timestamp()} taskList.push {device : deviceId, name : 'setParameterValues', parameterValues: setParameterValues, timestamp : new Date()}
if not presetsHash if not presetsHash
presetsHash = calculatePresetsHash(presets) presetsHash = calculatePresetsHash(presets)