tangled
alpha
login
or
join now
socksthewolf.com
/
skyscheduler
1
fork
atom
Schedule posts to Bluesky with Cloudflare workers.
skyscheduler.work
cf
tool
bsky-tool
cloudflare
bluesky
schedule
bsky
service
social-media
cloudflare-workers
1
fork
atom
overview
issues
pulls
pipelines
fix this dumb logic
great job blanco nino
SocksTheWolf
1 month ago
7ef04ec8
a23f1219
+7
-4
1 changed file
expand all
collapse all
unified
split
src
utils
queuePublisher.ts
+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
27
-
if (post.isThreadRoot && !shouldPostThreadQueue(env))
28
28
-
return;
29
29
-
else if (!isQueueEnabled(env))
27
27
+
if (post.isThreadRoot) {
28
28
+
if (!shouldPostThreadQueue(env))
29
29
+
return;
30
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
34
-
if (queueConsumer !== null)
35
35
+
36
36
+
if (queueConsumer !== null) {
35
37
await queueConsumer.send({type: QueueTaskType.Post, post: post} as QueueTaskData, { contentType: queueContentType });
38
38
+
}
36
39
}
37
40
38
41
export async function enqueueRepost(env: Bindings, post: Repost) {