Skip to content

Commit

Permalink
Merge pull request #15 from ethereumfollowprotocol/missing-events-and…
Browse files Browse the repository at this point in the history
…-migrations

timings for event loop
  • Loading branch information
0xthrpw authored Jul 12, 2024
2 parents 9bfbf11 + 77ce1c3 commit 626f288
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ BEGIN
v.record_type,
v.record_data,
v.tags,
v.updated_at,
following_info.is_following,
following_info.is_blocked,
following_info.is_muted
Expand Down
2 changes: 1 addition & 1 deletion src/pubsub/publisher/contract-event-publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class ContractEventPublisher implements EventPublisher {
let i = 0
const logs: Log[] = []
for (const eventSignature of eventSignatures) {
await sleep(2_500)
await sleep(500)
console.log(
`Fetching historical logs for ${this.contractName} ${eventSignature} (${++i}/${eventSignatures.length})`
)
Expand Down
2 changes: 2 additions & 0 deletions src/pubsub/publisher/event-interleaver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import BinaryHeap from 'heap-js'
import { logger } from '#/logger'
import { type Event, compareEvents } from '#/pubsub/event'
import type { EventSubscriber } from '#/pubsub/subscriber/interface'
import { sleep } from '#/utilities/index'
import type { EventPublisher } from './interface'

type ReceivedEvent = {
Expand Down Expand Up @@ -165,6 +166,7 @@ export class EventInterleaver implements EventPublisher, EventSubscriber {
await this.#propagateBatch(batch)
batch = []
}
await sleep(1000)
}

// Propagate any remaining events in the last batch
Expand Down

0 comments on commit 626f288

Please sign in to comment.