also looking at this
UI polish, real queue + scheduling, Bluesky threads, live analytics, blog target
#8
54 files
+2036
-589
| @@ -0,0 +1,19 @@ | ||
| 1 | import { Job } from '@stacksjs/queue' | |
| 2 | import { Every } from '@stacksjs/types' | |
| 3 | import { postQueue } from '../Services/Social/QueueService' | |
| 4 | ||
| 5 | export default new Job({ | |
| 6 | name: 'PublishScheduledPosts', | |
| 7 | description: 'Publish scheduled Postline posts whose time has come', | |
| 8 | queue: 'default', | |
| 9 | tries: 1, | |
| 10 | backoff: 3, | |
| 11 | rate: Every.Minute, | |
| 12 | ||
| 13 | handle: async () => { | |
| 14 | const { published, failed } = await postQueue.publishDue() | |
| 15 | if (published || failed) | |
| 16 | console.log(`[postline] scheduled publish run: ${published} published, ${failed} failed`) | |
| 17 | return { published, failed } | |
| 18 | }, | |
| 19 | }) | |