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

support for optionally using a PD for the db; better error handling #276

Merged
merged 2 commits into from
Dec 20, 2016

Conversation

amygdala
Copy link
Contributor

For the NL API slackbot: add support for optionally using a PD for the db in the k8s app; better error handling. Also changed db query to get the top entities from only the last 7 days.

// Query the database for the top N entities
db.all(ENTITIES_SQL, (err, topEntities) => {
// Query the database for the top N entities in the past week
let queryTs = Math.floor(Date.now() / 1000) - SEVEN_DAYS_AGO;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change let to const

db.all(ENTITIES_SQL, (err, topEntities) => {
// Query the database for the top N entities in the past week
let queryTs = Math.floor(Date.now() / 1000) - SEVEN_DAYS_AGO;
let entitiesWeekSql = ENTITIES_BASE_SQL + ` WHERE ts > ${queryTs}` + ENTITIES_SQL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to:

const entitiesWeekSql = `${ENTITIES_BASE_SQL} WHERE ts > ${queryTs}${ENTITIES_SQL}`;

@jmdobry jmdobry assigned amygdala and unassigned jmdobry Dec 20, 2016
@codecov-io
Copy link

codecov-io commented Dec 20, 2016

Current coverage is 93.88% (diff: 100%)

Merging #276 into master will decrease coverage by 0.07%

@@             master       #276   diff @@
==========================================
  Files            67         67          
  Lines          2519       2519          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits           2367       2365     -2   
- Misses          152        154     +2   
  Partials          0          0          

Powered by Codecov. Last update 8c649c4...4185b75

@amygdala
Copy link
Contributor Author

Done. Thanks.

@amygdala amygdala assigned jmdobry and amygdala and unassigned amygdala and jmdobry Dec 20, 2016
@jmdobry jmdobry merged commit 0389631 into master Dec 20, 2016
@jmdobry jmdobry deleted the sbpd branch December 20, 2016 20:02
NimJay pushed a commit that referenced this pull request Nov 10, 2022
…276)

* support for optionally using a PD for the db; better error handling

* readme and code cleanup
NimJay pushed a commit that referenced this pull request Nov 10, 2022
* updated CHANGELOG.md [ci skip]

* updated package.json [ci skip]

* updated samples/package.json [ci skip]
NimJay pushed a commit that referenced this pull request Nov 10, 2022
…276)

* support for optionally using a PD for the db; better error handling

* readme and code cleanup
NimJay pushed a commit that referenced this pull request Nov 10, 2022
* updated CHANGELOG.md [ci skip]

* updated package.json [ci skip]

* updated samples/package.json [ci skip]
ace-n pushed a commit that referenced this pull request Nov 14, 2022
pattishin pushed a commit that referenced this pull request Nov 18, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ace-n pushed a commit that referenced this pull request Nov 21, 2022
ace-n pushed a commit that referenced this pull request Nov 21, 2022
pattishin pushed a commit that referenced this pull request Nov 22, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

3 participants