···22import { inngest } from "app/api/inngest/client";
33import { index_post_mention } from "./functions/index_post_mention";
44import { come_online } from "./functions/come_online";
55+import { batched_update_profiles } from "./functions/batched_update_profiles";
5667// Create an API that serves zero functions
78export const { GET, POST, PUT } = serve({
89 client: inngest,
99- functions: [index_post_mention, come_online],
1010+ functions: [index_post_mention, come_online, batched_update_profiles],
1011});
+7-4
appview/index.ts
···138138 if (evt.collection === ids.AppBskyActorProfile) {
139139 //only listen to updates because we should fetch it for the first time when they subscribe!
140140 if (evt.event === "update") {
141141- await supabaseServerClient
142142- .from("bsky_profiles")
143143- .update({ record: evt.record as Json })
144144- .eq("did", evt.did);
141141+ await inngest.send({
142142+ name: "appview/profile-update",
143143+ data: {
144144+ did: evt.did,
145145+ record: evt.record,
146146+ },
147147+ });
145148 }
146149 }
147150 if (evt.collection === "app.bsky.feed.post") {