use DB connector instead of web API #158

Merged
nikooo777 merged 11 commits from chainquery-db-connection into master 2019-10-31 20:57:53 +01:00
nikooo777 commented 2019-07-08 23:11:05 +02:00 (Migrated from github.com)

using the web API is not smart. this PR fixes that issue

using the web API is not smart. this PR fixes that issue
tiger5226 (Migrated from github.com) requested changes 2019-07-10 03:45:38 +02:00
tiger5226 (Migrated from github.com) left a comment

We cannot remove that logging. It's important that we see that. Otherwise, I did not test this out with the app. I know you said it is pretty solid. Maybe @tzarebczan can take a look too in dev to make sure its good to go.

We cannot remove that logging. It's important that we see that. Otherwise, I did not test this out with the app. I know you said it is pretty solid. Maybe @tzarebczan can take a look too in dev to make sure its good to go.
tiger5226 (Migrated from github.com) commented 2019-07-10 03:40:11 +02:00

I put this here intentionally. I need to know when they fail so I can make sure I fix any data in chainquery. We should however, make sure its not hardcoded and only production reports.

I put this here intentionally. I need to know when they fail so I can make sure I fix any data in chainquery. We should however, make sure its not hardcoded and only production reports.
tiger5226 (Migrated from github.com) commented 2019-07-10 03:43:11 +02:00

I don't know if this is right brother. I needs to be pushed as a json string for it to work properly. I would need to test this. However, I think you think this is pretty solid.

I don't know if this is right brother. I needs to be pushed as a json string for it to work properly. I would need to test this. However, I think you think this is pretty solid.
kauffj (Migrated from github.com) reviewed 2019-07-10 23:50:48 +02:00
kauffj (Migrated from github.com) left a comment

Just some best practice suggestions in a file that doesn't look like it's adhering too closely to them in the first place 😛

Just some best practice suggestions in a file that doesn't look like it's adhering too closely to them in the first place :stuck_out_tongue:
@ -9,3 +9,3 @@
import slack from 'node-slack';
import Slack from 'node-slack';
require('winston-daily-rotate-file');
kauffj (Migrated from github.com) commented 2019-07-10 23:45:01 +02:00

const is technically more appropriate than let here but it doesn't really matter

`const` is _technically_ more appropriate than `let` here but it doesn't really matter
kauffj (Migrated from github.com) commented 2019-07-10 23:46:20 +02:00

these lines should probably go at top of file

these lines should probably go at top of file
kauffj (Migrated from github.com) commented 2019-07-10 23:48:14 +02:00

A slightly better pattern would be:

connection = getConnection()

function getConnection() {
  //instantiate singleton here
}
A slightly better pattern would be: `connection = getConnection()` ``` function getConnection() { //instantiate singleton here } ```
kauffj (Migrated from github.com) commented 2019-07-10 23:49:32 +02:00

Not strictly necessary but you can use Array.map for this:

const claims = results.map(r => {
          id                : r.id,
          name              : r.name,
          channel           : r.channel,
          bid_state         : r.bid_state,
          effective_amount  : r.effective_amount,
          certificate_amount: r.certificate_amount,
          claimId           : r.claimId,
          value             : r.value
})
Not strictly necessary but you can use `Array.map` for this: ``` const claims = results.map(r => { id : r.id, name : r.name, channel : r.channel, bid_state : r.bid_state, effective_amount : r.effective_amount, certificate_amount: r.certificate_amount, claimId : r.claimId, value : r.value }) ```
tzarebczan commented 2019-09-18 17:29:12 +02:00 (Migrated from github.com)

@nikooo777 what's the status of this PR? Sitting out here a while.

@nikooo777 what's the status of this PR? Sitting out here a while.
nikooo777 commented 2019-09-19 04:54:23 +02:00 (Migrated from github.com)

I have to find time to clean it up... I'll try to get that done asap.

I have to find time to clean it up... I'll try to get that done asap.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lighthouse.js#158
No description provided.