Barış Soner Uşaklı
cd2e68cb2d
feat: remove unused code, add 2 tests
6 years ago
Barış Soner Uşaklı
53e1b349ae
Change post owner ( #7752 )
...
* feat: #7749 , allow array of keys for setObject
* feat: sortedSetRemoveBulk
* feat: test for bulk remove
* feat: #7083 , ability to change post ownership
* feat: #7083 , fix tid:<tid>:posters
* feat: #7083 , front end
* fix : #7752 , psql methods
* fix: add missing await
* fix: maybe psql
6 years ago
Barış Soner Uşaklı
805dcd7ca2
Async refactor in place ( #7736 )
...
* feat: allow both callback&and await
* feat: ignore async key
* feat: callbackify and promisify in same file
* Revert "feat: callbackify and promisify in same file"
This reverts commit cea206a9b8e6d8295310074b18cc82a504487862.
* feat: no need to store .callbackify
* feat: change getTopics to async
* feat: remove .async
* fix: byScore
* feat: rewrite topics/index and social with async/await
* fix: rewrite topics/data.js
fix issue with async.waterfall, only pass result if its not undefined
* feat: add callbackify to redis/psql
* feat: psql use await
* fix: redis 🌋
* feat: less returns
* feat: more await rewrite
* fix: redis tests
* feat: convert sortedSetAdd
rewrite psql transaction to async/await
* feat: 🐶
* feat: test
* feat: log client and query
* feat: log bind
* feat: more logs
* feat: more logs
* feat: check perform
* feat: dont callbackify transaction
* feat: remove logs
* fix: main functions
* feat: more logs
* fix: increment
* fix: rename
* feat: remove cls
* fix: remove console.log
* feat: add deprecation message to .async usage
* feat: update more dbal methods
* fix: redis :voodoo:
* feat: fix redis zrem, convert setObject
* feat: upgrade getObject methods
* fix: psql getObjectField
* fix: redis tests
* feat: getObjectKeys
* feat: getObjectValues
* feat: isObjectField
* fix: add missing return
* feat: delObjectField
* feat: incrObjectField
* fix: add missing await
* feat: remove exposed helpers
* feat: list methods
* feat: flush/empty
* feat: delete
* fix: redis delete all
* feat: get/set
* feat: incr/rename
* feat: type
* feat: expire
* feat: setAdd
* feat: setRemove
* feat: isSetMember
* feat: getSetMembers
* feat: setCount, setRemoveRandom
* feat: zcard,zcount
* feat: sortedSetRank
* feat: isSortedSetMember
* feat: zincrby
* feat: sortedSetLex
* feat: processSortedSet
* fix: add mising await
* feat: debug psql
* fix: psql test
* fix: test
* fix: another test
* fix: test fix
* fix: psql tests
* feat: remove logs
* feat: user arrow func
use builtin async promises
* feat: topic bookmarks
* feat: topic.delete
* feat: topic.restore
* feat: topics.purge
* feat: merge
* feat: suggested
* feat: topics/user.js
* feat: topics modules
* feat: topics/follow
* fix: deprecation msg
* feat: fork
* feat: topics/posts
* feat: sorted/recent
* feat: topic/teaser
* feat: topics/tools
* feat: topics/unread
* feat: add back node versions
disable deprecation notice
wrap async controllers in try/catch
* feat: use db directly
* feat: promisify in place
* fix: redis/psql
* feat: deprecation message
logs for psql
* feat: more logs
* feat: more logs
* feat: logs again
* feat: more logs
* fix: call release
* feat: restore travis, remove logs
* fix: loops
* feat: remove .async. usage
6 years ago
Barış Soner Uşaklı
bd640a1107
Topic await errors ( #7727 )
...
* feat: derp await
* feat: restore user.getSettings
* feat: cleanup
* feat: make tid const
* feat: cleanup
* fix: tests
* feat: deprecate filter:controllers.topic.get
* feat: rewrite post-index logic
* feat: change calculation to match others
* fix: use .async
* feat: remove try/catch wrapper
6 years ago
Barış Soner Uşaklı
cb51c239f2
feat: remove duped zadds, these are already in topics.onNewPostMade
6 years ago
Barış Soner Uşaklı
f8a7cf7378
feat: log data on error
6 years ago
Barış Soner Uşaklı
198d05875f
feat: cleanup, use bulk
6 years ago
Barış Soner Uşaklı
3ecd703ea3
feat: #7707 , added sortedSetAddBulk
6 years ago
Barış Soner Uşaklı
a39f0ef592
fix : #5570 , create per category user post zsets
6 years ago
Barış Soner Uşaklı
3780a58ffb
feat: shorter setsCard
6 years ago
Barış Soner Uşaklı
ebfc369ade
feat: upgrade to connect-mongo 3.0.0, closes #7693
6 years ago
Baris Usakli
8d319e4280
fix: psql error
6 years ago
Baris Usakli
2e6b562f1e
fix: try to fix psql 🐶
6 years ago
Baris Usakli
31ccc860d3
feat: allow multiple scores in sortedSetsAdd
6 years ago
Barış Soner Uşaklı
4d9bc30d1f
feat: async3 upgrade ( #7639 )
...
* feat: async3 upgrade WIP
* fix: async.doWhilst
* fix: async early exit
* fix: psql doUntil
* fix: psql again
6 years ago
Barış Soner Uşaklı
2c98dd5f9d
Object cache refactor ( #7558 )
...
* fix: cache refactor
db.getObjectField no longer loads entire object
db.getObjectsFields only clones data once
more tests
* feat: add back cache to redis
db.getObjectField no longer loads entire object
6 years ago
Barış Soner Uşaklı
4df925e76a
fix: remove redis object cache
6 years ago
Baris Usakli
45d7e37ae8
fix: tests
6 years ago
Baris Usakli
b48b6d75e5
fix: callbacks
6 years ago
Baris Usakli
7addc5a0e2
fix: return early if keys is empty
6 years ago
Baris Usakli
b3962c1694
fix: return early if keys is empty
6 years ago
Barış Soner Uşaklı
5917dec288
fix: only allow numbers as scores ( #7356 )
...
* zadd score checks
* fix: only allow numbers as scores
* fix: convert values to strings
6 years ago
Barış Soner Uşaklı
2e2c3ac110
fix : #7352
6 years ago
Barış Soner Uşaklı
fab52b840c
fix: prevent crash if results.stats or results.serverStatus is undefined
6 years ago
Barış Soner Uşaklı
a22a3a9861
fix: log error to prevent headers already sent
...
retry on uniq index fail
6 years ago
Peter Jaszkowiak
e1ca2d81f9
refactor: use loash when possible ( #7230 )
6 years ago
Barış Soner Uşaklı
3917022a48
fix : #7139
6 years ago
Barış Soner Uşaklı
fef7e13c9e
feat: small fixes
6 years ago
Barış Soner Uşaklı
d2c2d56f59
feat: change sortedSetsScore
6 years ago
Barış Soner Uşaklı
29b63ae7fb
fix : #6979
6 years ago
Barış Soner Uşaklı
00afc5b3ab
fix: remove log
6 years ago
Barış Soner Uşaklı
eb7ae54f81
Category watch state ( #7109 )
...
* feat: wip, category watch change
* feat: pass data to client
* feat: allow changing state
* fix: account page categories
* fix: show in unread if topic is followed or category is watched
* feat: add default watch state to acp
* feat: save user category watch state
* feat: update unread recent pages
* fix: remove dupe code
* fix: flip conditions
* fix: handle empty arrays
* fix: ignore/watch on others profile
* feat: upgrade script for category states
if there are any users ignoring categories set their state in new zset and delete cid:<cid>:ignorers
* fix: upgrade
* fix: tests
* fix: redis count
* fix: more tests
6 years ago
Barış Soner Uşaklı
d117df77f7
fix : #7102
6 years ago
Barış Soner Uşaklı
85a07e999b
fix : #7102
6 years ago
Barış Soner Uşaklı
263c918088
feat: remove uid:<uid>:ignored:cids ( #7099 )
...
use cid:<cid>:ignorers instead
6 years ago
Barış Soner Uşaklı
26ccd8f626
fix: db info page
...
if there is no connection to db, connect first
6 years ago
Baris Usakli
e65d40c937
dont return undefined from sortedSetsCard if keys is empty or falsy
6 years ago
Baris Usakli
420227faae
parseFloat scores
6 years ago
Barış Soner Uşaklı
6330d51446
less derpy output
6 years ago
Barış Soner Uşaklı
ed1bf9a16f
add more info to advanced db page
6 years ago
Barış Soner Uşaklı
53ad2bbd6e
Categories optimize ( #6999 )
...
* WIP
* fix category page
* fix counts, and copyPrivileges
* fix lint
* more fixes,
* redis fix
* fix test
* fix category test
* remove getParentsAndChildren
6 years ago
Barış Soner Uşaklı
0524fd9caa
closes #6996 ( #6997 )
...
* closes #6996
* fix lint
6 years ago
Baris Usakli
7b9a2caec3
closes #6994
6 years ago
Barış Soner Uşaklı
1c981e638b
rename query name
6 years ago
Barış Soner Uşaklı
ca1e3a758b
#6986
6 years ago
Barış Soner Uşaklı
48690a01b9
dont need to call multi if keys.length is 0
6 years ago
Barış Soner Uşaklı
07f83c5078
fix redis tests
6 years ago
Barış Soner Uşaklı
f8e219c323
handle empty set, add test
6 years ago
Barış Soner Uşaklı
75816deca7
add cache to redis ( #6917 )
...
* add cache to redis
move out cache module from mongo
* fix redis tests
* add callback noop
* fix typo
* del cache on field delete
* make redis/mongo caches separate
6 years ago
Barış Soner Uşaklı
0de60cfdca
fix mongodb tests
6 years ago
Barış Soner Uşaklı
8ca36ad122
closes #6890
6 years ago
Barış Soner Uşaklı
7aa937a657
remove dupe code in mongodb sorted
6 years ago
Barış Soner Uşaklı
c27be9db5a
Recent refactor ( #6879 )
...
* wip
* fix inf scroll
* remove duplicated code
* remove dupe code in /unread
* use topicList
* update tag page to use topicList
* fix tests
* combine ifs
* remove more dupe code
* disable timeout
6 years ago
Baris Usakli
51792da430
dont crash if there is nothing to write
6 years ago
Barış Soner Uşaklı
fb6067a7ca
only parse if field is requested
6 years ago
Baris Usakli
138154a71c
move modules
6 years ago
Barış Soner Uşaklı
b2b33ffa57
topics data refactor
6 years ago
Barış Soner Uşaklı
26d4e0852f
use includes instead of indexOf
...
use _.uniq instead of filter&indexOf
6 years ago
Barış Soner Uşaklı
986511e718
try with higher timeout
6 years ago
Barış Soner Uşaklı
1d15dc089b
revert isCluster
6 years ago
Barış Soner Uşaklı
0aebb9caf8
closes #6844
6 years ago
Barış Soner Uşaklı
154d7076d9
dont pass options
6 years ago
Barış Soner Uşaklı
9dbe68a9cb
testing again
6 years ago
Barış Soner Uşaklı
aa567a5f2d
print out connString and opts
6 years ago
Barış Soner Uşaklı
2d8d234c57
test mongodb again
6 years ago
Barış Soner Uşaklı
e615391b22
convert values to string before removing
6 years ago
Barış Soner Uşaklı
18d0deeccb
update deprecated methods ( #6794 )
7 years ago
Ben Lubar
11b655163e
Only run the DDL for session storage on the primary instance. ( #6788 )
...
This fixes a restart loop caused by deadlocks in large clusters.
7 years ago
Barış Soner Uşaklı
9724ef083e
remove v from query
7 years ago
Barış Soner Uşaklı
786311fa64
use value
7 years ago
Barış Soner Uşaklı
5a69f979a8
update processSortedSet to use withScores
7 years ago
Ben Lubar
97a3079bc0
Optimize PostgreSQL session store.
...
- Sets session ID to be a constant-sized character field inline in the
table instead of a variable-length character field compressed outside
of the row.
- Changes the session data from "json" to "jsonb" which is faster and
smaller on disk with the drawback of not maintaining key order and
whitespace (which we don't care about at all)
- Adds a clustered index on the session expiration timestamp, which will
make periodic session purging much faster.
(For an example, WTDWTF currently has 482355 sessions in the table, and
because there is no index on the expiration timestamp, PostgreSQL must
check all the rows in the table every time.)
This upgrade script can run concurrently with a live NodeBB instance,
but any action that touches sessions will wait until the upgrade script
is done.
Does not touch the database if the database driver is not set to
PostgreSQL or if there is a Redis database configured.
7 years ago
Barış Soner Uşaklı
0519f84734
Promisify modules ( #6723 )
...
* WIP promisify
* promisify psql
* ability to skip some keys
* dont promisify client object
* remove async
* clone entire module so it has all properties
* add shim for node 6
* ignore sessionStore as well
* ignore pool on psql
7 years ago
Ben Lubar
33228bb7fe
PostgreSQL database driver ( #5861 )
...
* [test/database/list] Fix test list 4 being used in two different tests
* [database/postgres] PostgreSQL database driver
* [database/postgres] Make transactions work based on continuation scope.
* [database/postgres] Implement nested transactions
* eslint --fix
* Add database changes from earlier this week to the PostgreSQL driver.
* Fix typo
* Fix postgres.incrObjectFieldBy returning undefined instead of null when given NaN
* [database/postgres] Fix sortedSetsCard returning an array of strings.
* Update socket.io postgres adapter
* Fix PostgreSQL erroring when multiple updates are made to the same sorted set entry in a single operation.
Add a test case to catch this error.
* Fix lint errors.
* Only prune sessions on one instance in a cluster to avoid deadlocks.
They're caught and handled by the database server, but they spam the logs.
* Fix arguments.slice.
7 years ago
Baris Usakli
16a7728ab8
fix redis warnings
7 years ago
Barış Soner Uşaklı
fe80186ddf
add withscores
7 years ago
Barış Soner Uşaklı
8263f81d0c
fix pubsub when only mongodb is used
7 years ago
Barış Soner Uşaklı
3b5d6951bb
closes #6499
7 years ago
Barış Soner Uşaklı
77d47b31fb
cleanly shutdown
...
wait for webserver to stop accepting connections
destroy current connections
wait for db connection to close
7 years ago
Baris Usakli
3c4b4f5263
don't call calback twice #6375
7 years ago
Barış Soner Uşaklı
be5c237388
fix decr/incrObjectField if key in array doesn't exist create it
7 years ago
Barış Soner Uşaklı
6a9a73c86c
changes to leaveAllGroups
...
Groups.destroy can take an array of groupnames
Groups.leave can take an array of groupnames
db.incrObjectField/decrObjectField can take an array of keys
db.sortedSetRemove can take an array of keys and values
db.setRemove can take an array of keys
7 years ago
Baris Usakli
38acedf5bb
lint
7 years ago
Baris Usakli
959a742c63
add llen to dbal
7 years ago
Barış Soner Uşaklı
bce640e514
closes #6340
7 years ago
Barış Soner Uşaklı
7a2d6fe22d
Merge remote-tracking branch 'refs/remotes/origin/master' into develop
7 years ago
Barış Soner Uşaklı
b084a596fa
closes #6301
7 years ago
Barış Soner Uşaklı
c0b7d4f5b5
fix redis export
7 years ago
Barış Soner Uşaklı
8a6345ded7
possible fix for pubsub
7 years ago
Ben Lubar
e85aabbe74
Allow running as a cluster without Redis ( #6233 )
...
* [database/*] Allow databases other than Redis to provide pubsub for clustering if Redis is not present
* [pubsub] Delay messages sent before the database is ready until the database is ready.
* [pubsub] Restore old behavior of not using the database in non-clustered NodeBB instances.
See comment: https://github.com/NodeBB/NodeBB/pull/6233#issuecomment-357814968
7 years ago
Julian Lam
457194b333
Merge branch 'master' into develop
7 years ago
Barış Soner Uşaklı
e092778ba6
closes #6200
7 years ago
Ben Lubar
5b1ed21634
[database/mongo] Improve speed of sortedSetRank ( #6229 )
...
* [database/mongo] Improve speed of sortedSetRank
* [database/mongo] Fix sortedSetRank to filter by _key
7 years ago
Barış Soner Uşaklı
5146f43b33
remove console.log
7 years ago
Barış Soner Uşaklı
87d40e9e78
fix increment to use data
7 years ago
Barış Soner Uşaklı
cbaa977233
fix type on mongodb if key has expireAt
7 years ago
Barış Soner Uşaklı
ea8cf6545c
change db.set/get to use data field instead of value
7 years ago
Barış Soner Uşaklı
8e04e86e24
closes #5912
7 years ago
Baris Usakli
5ca3b535e7
closes #6105
7 years ago
Baris Usakli
dbf815ed47
closes #6103
7 years ago