Skip to content

Commit

Permalink
🐛 Fix campaign stats
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed Jul 24, 2024
1 parent f105f45 commit 40080fa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
28 changes: 13 additions & 15 deletions packages/erpc/erpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ logLevel: warn
database:
# todo: Should use the same postgres as the indexer but on a different schema
evmJsonRpcCache:
driver: memory
# driver: postgresql
# postgresql:
# connectionUri: >-
# postgres://YOUR_USERNAME_HERE:[email protected]:5432/your_database_name
# table: rpc_cache
driver: postgresql
postgresql:
connectionUri: ${DATABASE_URL}
table: rpc_cache
server:
httpHost: 0.0.0.0
httpPort: 4000
Expand All @@ -24,15 +22,15 @@ projects:
chainId: 421614
failsafe:
timeout:
duration: 30s
duration: 120s
retry:
maxCount: 5
delay: 500ms
backoffMaxDelay: 10s
backoffFactor: 0.3
jitter: 200ms
backoffMaxDelay: 20s
backoffFactor: 2
jitter: 500ms
hedge:
delay: 1000ms
delay: 2000ms
maxCount: 2
# Arb
- architecture: evm
Expand All @@ -45,14 +43,14 @@ projects:
maxCount: 5
delay: 500ms
backoffMaxDelay: 10s
backoffFactor: 0.3
backoffFactor: 0.5
jitter: 200ms
hedge:
delay: 1000ms
maxCount: 2
upstreams:
- id: alchemy-multi-chain
endpoint: alchemy://XXXX_YOUR_ALCHEMY_API_KEY_HERE_XXXX
endpoint: alchemy://${ALCHEMY_API_KEY}
rateLimitBudget: global
healthCheckGroup: default-hcg
allowMethods:
Expand All @@ -73,12 +71,12 @@ rateLimiters:
- id: default-budget
rules:
- method: "*"
maxCount: 10000
maxCount: 200
period: 1s
healthChecks:
groups:
- id: default-hcg
checkInterval: 30s
checkInterval: 300s
maxErrorRatePercent: 10
maxP90LatencyMs: 5s
maxBlocksBehind: 5
4 changes: 2 additions & 2 deletions packages/ponder/src/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export async function increaseCampaignsInteractions({
for (const campaign of campaigns.items) {
// Create the stats if not found
await PressCampaignStats.upsert({
id: campaign,
id: campaign.id,
create: {
campaignId: campaign,
campaignId: campaign.id,
totalInteractions: 0n,
openInteractions: 0n,
readInteractions: 0n,
Expand Down

0 comments on commit 40080fa

Please sign in to comment.