this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

added cursor logging

+27 -18
+16 -3
src/label.ts
··· 10 10 const repo = await agent 11 11 .withProxy("atproto_labeler", DID) 12 12 .api.tools.ozone.moderation.getRepo({ did: did }) 13 - .catch((err) => console.log(err)); 13 + .catch((err) => { 14 + console.log({ 15 + error: err, 16 + }); 17 + }); 14 18 15 19 if (!repo) return; 16 20 ··· 33 37 createdAt: new Date().toISOString(), 34 38 subjectBlobCids: [], 35 39 }) 36 - .catch((err) => console.log(err)); 40 + .catch((err) => { 41 + console.log({ 42 + error: err, 43 + }); 44 + }) 45 + .then(() => console.log(`Deleted labels for ${did}`)); 37 46 return; 38 47 } 39 48 ··· 56 65 createdAt: new Date().toISOString(), 57 66 subjectBlobCids: [], 58 67 }) 59 - .catch((err) => console.log(err)) 68 + .catch((err) => { 69 + console.log({ 70 + error: err, 71 + }); 72 + }) 60 73 .then(() => console.log(`Labeled ${did} with ${post}`)); 61 74 } 62 75 };
+11 -15
src/main.ts
··· 7 7 8 8 const subscribe = async () => { 9 9 const agent = await getAgent(); 10 + let cursorSave = 0; 10 11 11 12 // add firehose cursor save 13 + //const firehose = new Firehose({ cursor: "760303563" }); 12 14 const firehose = new Firehose(); 13 15 14 - firehose.on("error", ({ cursor }) => { 15 - agent.api.chat.bsky.convo.sendMessage( 16 - { 17 - convoId: process.env.CONVO_ID ?? "", 18 - message: { 19 - text: `Firehose errored on cursor: ${cursor}`, 20 - }, 21 - }, 22 - { 23 - encoding: "application/json", 24 - headers: { 25 - "atproto-proxy": "did:web:api.bsky.chat#bsky_chat", 26 - }, 27 - }, 28 - ); 16 + firehose.on("error", async ({ cursor }) => { 17 + console.log(`Firehose errored on cursor: ${cursor}`); 18 + }); 19 + 20 + firehose.on("open", () => { 21 + setInterval(() => { 22 + console.log(`cursor: ${cursorSave}`); 23 + }, 60000); 29 24 }); 30 25 31 26 firehose.on("commit", (commit) => { 27 + cursorSave = commit.seq; 32 28 for (const op of commit.ops) { 33 29 if (op.action === "delete") continue; 34 30 if (AppBskyFeedLike.isRecord(op.record)) {