14 Commits (39cac43b96227425bfc74367fffa57f76a62c545)

Author SHA1 Message Date
barisusakli 39cac43b96 if key isn't found dont error
Conflicts:
	src/database/redis/main.js
10 years ago
barisusakli f67053df52 figure out pathname, dont crash if callback isnt supplied 10 years ago
barisusakli 1cbf5ddfe9 only send back err on redis.deleteAll 10 years ago
barisusakli 7cf3719c80 fix rename and increment 10 years ago
barisusakli bf54859a27 key tests 10 years ago
barisusakli 1d2d69fa45 use helpers, redis crash fix 11 years ago
barisusakli 0a44d3f5e0 moved updateCategoryField out, db.delete only sends back err 11 years ago
barisusakli 2252ab7479 notifications.prune
run every hour
dont get more than 500 notifications
11 years ago
barisusakli e6d8e9c959 searchIndex callbacks 11 years ago
Charles 90b2d766f7 Fix callback execution in redis search
`callback` should be passed to `reds.search` otherwise the execution will be overlapped. 

For example in the plugin `nodebb-plugin-dbsearch':

```javascript
db.searchRemove('topic', tid, function() {
	if (typeof title === 'string' && title.length) {
		db.searchIndex('topic', title, tid);
	}

	if (typeof callback === 'function') {
		callback();
	}
});
```

The actual execution is like this

```
1402387863.625553 [0 127.0.0.1:16660] "zrevrangebyscore" "nodebbtopicsearch:object:6" "+inf" "0"
1402387863.625891 [0 127.0.0.1:16660] "MULTI"
1402387863.626043 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:123" "1" "6"
1402387863.626052 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "123"
1402387863.626060 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:TST" "1" "6"
1402387863.626065 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "TST"
1402387863.626071 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:AN0" "1" "6"
1402387863.626076 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "AN0"
1402387863.626083 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:TPK" "1" "6"
1402387863.626092 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "TPK"
1402387863.626104 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:ETTT" "1" "6"
1402387863.626116 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "ETTT"
1402387863.626130 [0 127.0.0.1:16660] "EXEC"
1402387863.626253 [0 127.0.0.1:16660] "del" "topic:6:tags"
1402387863.626281 [0 127.0.0.1:16660] "MULTI"
1402387863.626515 [0 127.0.0.1:16660] "del" "nodebbtopicsearch:object:6"
1402387863.626524 [0 127.0.0.1:16660] "EXEC"
```

The key nodebbtopicsearch:object is added and then just being deleted again.
11 years ago
Julian Lam e64c1bfec3 closed #1453 11 years ago
Julian Lam bab140c396 added pexpire and pexpireAt methods for redis and mongo. Added emoticons for leveldb (as per existing implementation by @psychobunny LOL) 11 years ago
psychobunny bba3df6802 moving db.close into the parent module 11 years ago
psychobunny 9ad7ce9ca8 organizing redis driver 11 years ago