Skip to content

Commit

Permalink
formatting, subscription loop timing
Browse files Browse the repository at this point in the history
  • Loading branch information
0xthrpw committed Aug 1, 2024
1 parent d49d245 commit 5f1b295
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
-------------------------------------------------------------------------------
CREATE TABLE
public.efp_leaderboard (
"name" TEXT NOT NULL,
"address" types.eth_address NOT NULL,
"name" TEXT,
"avatar" TEXT,
"mutuals" BIGINT,
"following" BIGINT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ OR REPLACE VIEW public.view__events__efp_accounts_with_primary_list AS
SELECT
v.user as address,
v.token_id as primary_list_token_id
FROM efp_lists as v, efp_account_metadata AS meta
FROM public.efp_lists as v, public.efp_account_metadata AS meta
WHERE
meta.address = v.user AND
convert_hex_to_bigint(meta.value) = v.token_id;
public.convert_hex_to_bigint(meta.value) = v.token_id;


-- migrate:down
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ FROM
LEFT JOIN PUBLIC.efp_lists AS l ON l.list_storage_location_chain_id = record_tags.chain_id
AND l.list_storage_location_contract_address = record_tags.contract_address
AND l.list_storage_location_slot = record_tags.slot
INNER JOIN efp_account_metadata meta ON l.user = meta.address AND l.token_id = convert_hex_to_bigint(meta.value);
INNER JOIN public.efp_account_metadata meta ON l.user = meta.address AND l.token_id = public.convert_hex_to_bigint(meta.value);



Expand Down
13 changes: 13 additions & 0 deletions src/database/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ export interface EfpAccountMetadata {
value: string
}

export interface EfpLeaderboard {
address: string
avatar: string | null
blocks: Int8 | null
created_at: Generated<Timestamp | null>
followers: Int8 | null
following: Int8 | null
mutuals: Int8 | null
name: string
updated_at: Generated<Timestamp | null>
}

export interface EfpListMetadata {
chain_id: Int8
contract_address: string
Expand Down Expand Up @@ -300,6 +312,7 @@ export interface ViewLatestFollows {
export interface DB {
contracts: Contracts
efp_account_metadata: EfpAccountMetadata
efp_leaderboard: EfpLeaderboard
efp_list_metadata: EfpListMetadata
efp_list_nfts: EfpListNfts
efp_list_ops: EfpListOps
Expand Down
4 changes: 2 additions & 2 deletions src/pubsub/publisher/event-interleaver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class EventInterleaver implements EventPublisher, EventSubscriber {

async #processQueue(): Promise<void> {
const now = new Date()
const batchSize = 10
const batchSize = 100
// Muted by user
// biome-ignore lint/nursery/noEvolvingTypes: <explanation>
let batch = []
Expand All @@ -166,7 +166,7 @@ export class EventInterleaver implements EventPublisher, EventSubscriber {
await this.#propagateBatch(batch)
batch = []
}
await sleep(1000)
// await sleep(1000)
}

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

0 comments on commit 5f1b295

Please sign in to comment.