Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear how to log Cassandra connection issues #188

Open
jpiulac opened this issue Dec 7, 2018 · 0 comments
Open

Unclear how to log Cassandra connection issues #188

jpiulac opened this issue Dec 7, 2018 · 0 comments

Comments

@jpiulac
Copy link

jpiulac commented Dec 7, 2018

const config = {} ...
const Cassandra = require('express-cassandra');

models = Cassandra.createClient({
    clientOptions: {
      contactPoints: [config.cassandra_nodes],
      protocolOptions: { port: config.cassandra_port },
      keyspace: config.cassandra_keyspace,
      queryOptions: { consistency: Cassandra.consistencies.one },
    },
    ormOptions: {
      defaultReplicationStrategy: {
        class: 'SimpleStrategy',
        replication_factor: 1
      },
      migration: 'safe',
      createKeyspace: false
    }
  });

Not sure how to go about logging connection errors, or check connection success:
Used to be able to do:

model.connect((err, res) => {}) 

But this gives an error,
any way to check we are connected log success/error?

Didn't find a clear example in the docs.

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant