-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
This file contains 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
jmdobry
requested changes
Dec 20, 2016
// 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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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}`;
Current coverage is 93.88% (diff: 100%)@@ 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
|
Done. Thanks. |
jmdobry
approved these changes
Dec 20, 2016
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]
This was referenced Nov 14, 2022
unforced
pushed a commit
that referenced
this pull request
Nov 17, 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>
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
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 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.