-
Notifications
You must be signed in to change notification settings - Fork 4
feat: handle eligible deal stats via spark-api #206
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
Changes from 1 commit
1da625a
8863c1c
64d09b5
7712e73
11b3b1b
34981fd
d4f6045
6b1a7f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
import { | ||
getPgPools, | ||
migrateApiDB, | ||
migrateEvaluateDB, | ||
migrateStatsDB | ||
} from '@filecoin-station/spark-stats-db' | ||
|
||
const pgPools = await getPgPools() | ||
await migrateStatsDB(pgPools.stats) | ||
await migrateEvaluateDB(pgPools.evaluate) | ||
await migrateApiDB(pgPools.api) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import { getPgPools } from '@filecoin-station/spark-stats-db' | |
const { | ||
PORT = '8080', | ||
HOST = '127.0.0.1', | ||
SPARK_API_BASE_URL = 'https://api.filspark.com/', | ||
REQUEST_LOGGING = 'true' | ||
} = process.env | ||
|
||
|
@@ -17,7 +18,7 @@ const logger = { | |
request: ['1', 'true'].includes(REQUEST_LOGGING) ? console.info : () => {} | ||
} | ||
|
||
const handler = createHandler({ pgPools, logger }) | ||
const handler = createHandler({ SPARK_API_BASE_URL, pgPools, logger }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in this PR, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to make this configurable via env vars so we can run spark-stats locally with redirects to the local spark-api instance. With your proposal, I would have to edit the local config file and then remember to discard the changes before committing to git. In that light, do you still prefer to move this to the config file? I don't have a strong opinion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it, I didn't see that possibility. I never run these services in dev 😅 |
||
const server = http.createServer(handler) | ||
console.log('Starting the http server on host %j port %s', HOST, PORT) | ||
server.listen(Number(PORT), HOST) | ||
|
Uh oh!
There was an error while loading. Please reload this page.