Support caching in MongoDB instead of Redis

This commit is contained in:
Zaid Abdulla committed 2017-05-08 10:44:42 -07:00
1 parent c6328ce2f4
commit 624cf01270
10 files changed
+815 -535

No files matched your search

+2 -6
View File
@@ -27,6 +27,7 @@ common = require './common'
util = require 'util'
URL = require 'url'
auth = require './auth'
cache = require './cache'
udpConReq = (address, un, key, callback) ->
@@ -242,12 +243,7 @@ deleteDevice = (deviceId, callback) ->
return callback(err) if err
db.operationsCollection.remove({'_id' : {'$regex' : "^#{common.escapeRegExp(deviceId)}\\:"}}, (err) ->
return callback(err) if err
db.redisClient.del("#{deviceId}_presets_hash",
"#{deviceId}_inform_hash",
"#{deviceId}_faults",
"#{deviceId}_tasks",
"#{deviceId}_operations",
callback)
cache.del("#{deviceId}_tasks_faults_operations", callback)
)
)
)