Skip to content
5 changes: 4 additions & 1 deletion src/publishers/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ const RETRY_LIMIT = 5
*/
export const runPushPublisher = async (): Promise<number> => {
for await (const doc of viewToStream(async params =>
dbTasks.view('tasks_publishing', 'tasks_publishing', params)
Promise.resolve(
dbTasks.view('tasks_publishing', 'tasks_publishing', params)
)
)) {
const clean: TaskDoc = asTaskDoc(doc)
const currentTask = clean.doc
Expand Down Expand Up @@ -81,6 +83,7 @@ export const runPushPublisher = async (): Promise<number> => {
const canExecute = (task: Task): boolean => {
return (
task.action.inProgress == null &&
Comment thread
GoodluckH marked this conversation as resolved.
Outdated
task.action.type === 'push' &&
task.action.repeat == null &&
task.action.inProgress === false
)
Expand Down