Schedule posts to Bluesky with Cloudflare workers. skyscheduler.work
cf tool bsky-tool cloudflare bluesky schedule bsky service social-media cloudflare-workers

fix this dumb logic

great job blanco nino

+7 -4
+7 -4
src/utils/queuePublisher.ts
··· 24 24 export const shouldPostThreadQueue = (env: Bindings) => env.QUEUE_SETTINGS.threadEnabled && (hasPostQueue(env) || isQueueEnabled(env)); 25 25 26 26 export async function enqueuePost(env: Bindings, post: Post) { 27 - if (post.isThreadRoot && !shouldPostThreadQueue(env)) 28 - return; 29 - else if (!isQueueEnabled(env)) 27 + if (post.isThreadRoot) { 28 + if (!shouldPostThreadQueue(env)) 29 + return; 30 + } else if (!isQueueEnabled(env)) 30 31 return; 31 32 32 33 // Pick a random consumer to handle this post 33 34 const queueConsumer: Queue|null = getRandomQueue(env, "post_queues"); 34 - if (queueConsumer !== null) 35 + 36 + if (queueConsumer !== null) { 35 37 await queueConsumer.send({type: QueueTaskType.Post, post: post} as QueueTaskData, { contentType: queueContentType }); 38 + } 36 39 } 37 40 38 41 export async function enqueueRepost(env: Bindings, post: Repost) {