Open
Conversation
houndci-bot
reviewed
Jul 18, 2018
| this._splitChar = options.splitChar || null | ||
| this._tableMatch = this._splitChar ? | ||
| new RegExp('^(\\w+)' + this._escapeRegExp(this._splitChar)) : | ||
| null |
There was a problem hiding this comment.
Missing semicolon.
Too many errors. (21% scanned).
| this._defaultTable = options.defaultTable || 'deepstream_records' | ||
| this._splitChar = options.splitChar || null | ||
| this._tableMatch = this._splitChar ? | ||
| new RegExp('^(\\w+)' + this._escapeRegExp(this._splitChar)) : |
| this._reconnectCount = this._connection.reconnectCount | ||
| this._tableManager = new TableManager(this._connection) | ||
| this._defaultTable = options.defaultTable || 'deepstream_records' | ||
| this._splitChar = options.splitChar || null |
| this._connection = new Connection(options, this._onConnection.bind(this)) | ||
| this._reconnectCount = this._connection.reconnectCount | ||
| this._tableManager = new TableManager(this._connection) | ||
| this._defaultTable = options.defaultTable || 'deepstream_records' |
There was a problem hiding this comment.
Mixed double and single quotes.
Missing semicolon.
| this._options = options | ||
| this._connection = new Connection(options, this._onConnection.bind(this)) | ||
| this._reconnectCount = this._connection.reconnectCount | ||
| this._tableManager = new TableManager(this._connection) |
| */ | ||
| constructor(options) { | ||
| super() | ||
| this.isReady = false |
| * @constructor | ||
| */ | ||
| constructor(options) { | ||
| super() |
| * | ||
| * database specifies which database to use. Defaults to 'deepstream' | ||
| * defaultTable specifies which table records will be stored in that don't specify a table. Defaults to deepstream_records | ||
| * splitChar specifies a character that separates the record's id from the table it should be stored in. defaults to null |
| * Please note the three additional, optional keys: | ||
| * | ||
| * database specifies which database to use. Defaults to 'deepstream' | ||
| * defaultTable specifies which table records will be stored in that don't specify a table. Defaults to deepstream_records |
| * for instance will create a user table and store it in it. This will allow for more sophisticated queries as | ||
| * well as speed up read operations since there are less entries to look through | ||
| * | ||
| * @param {Object} options rethinkdb driver options. See rethinkdb.com/api/javascript/#connect |
houndci-bot
reviewed
Jul 19, 2018
|
|
||
| it( 'deletes dsTestA', ( done ) => { | ||
| conn = cacheConnector._connection.get() | ||
| conn = cacheConnector._connection.connection |
|
|
||
| it( 'deletes dsTestA', ( done ) => { | ||
| const conn = storageConnector._connection.get() | ||
| const conn = storageConnector._connection.connection |
There was a problem hiding this comment.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
Missing semicolon.
| setTimeout(() => cacheConnector.get('someValue', (error, value) => { | ||
| expect(error).to.equal(null) | ||
| expect(value).to.deep.equal(data) | ||
| done() |
There was a problem hiding this comment.
Missing semicolon.
Too many errors. (27% scanned).
| expect(error.msg).to.equal("Connection is closed.") | ||
| setTimeout(() => cacheConnector.get('someValue', (error, value) => { | ||
| expect(error).to.equal(null) | ||
| expect(value).to.deep.equal(data) |
| }).then(cacheConnector.get('someValue', (error) => { | ||
| expect(error.msg).to.equal("Connection is closed.") | ||
| setTimeout(() => cacheConnector.get('someValue', (error, value) => { | ||
| expect(error).to.equal(null) |
| setTimeout(() => cacheConnector.set('someValue', data, (error) => { | ||
| expect(error).to.equal(null) | ||
| done() | ||
| }), 1500) |
| expect(error.msg).to.equal("Connection is closed.") | ||
| setTimeout(() => cacheConnector.set('someValue', data, (error) => { | ||
| expect(error).to.equal(null) | ||
| done() |
| }).then(cacheConnector.set('someValue', data, (error) => { | ||
| expect(error.msg).to.equal("Connection is closed.") | ||
| setTimeout(() => cacheConnector.set('someValue', data, (error) => { | ||
| expect(error).to.equal(null) |
| noreplyWait: true | ||
| }).then(cacheConnector.set('someValue', data, (error) => { | ||
| expect(error.msg).to.equal("Connection is closed.") | ||
| setTimeout(() => cacheConnector.set('someValue', data, (error) => { |
There was a problem hiding this comment.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
| cacheConnector._connection._connection.close({ | ||
| noreplyWait: true | ||
| }).then(cacheConnector.set('someValue', data, (error) => { | ||
| expect(error.msg).to.equal("Connection is closed.") |
There was a problem hiding this comment.
Mixed double and single quotes.
Missing semicolon.
10d57d3 to
e6ad910
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For an uws issue, the rethinkdb instance in our cluster assigned to a deepstream instance sometimes crases. In such case, the deepstream instance cannot recover: it logs the lost connection then game over.
In this PR I have added some configurable reconnection logic (see the readme). If you don't specify the new config parameters, then deepstream should behave as before, however, when you do it, and the plugin is able to recognize the lost rethinkdb connection, then it will try to reconnect, then re-execute the failed operation.
Which means that the deepstream instance gets another, working rethinkdb instance from the cluster and completes the operation. Otherwise, it stays in the failed status as before.