Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications/qa fixes #256

Merged
12 changes: 5 additions & 7 deletions src/server-extension/resolvers/ChannelsResolver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ export class ChannelsResolver {
})
}

@Mutation(() => SuspendChannelResult)
@Mutation(() => [SuspendChannelResult])
@UseMiddleware(OperatorOnly())
async suspendChannels(
@Args() { channelIds }: SuspendChannelArgs
Expand Down Expand Up @@ -395,10 +395,9 @@ export class ChannelsResolver {
}

const limit = pLimit(5) // Limit to 5 concurrent promises
const existingChannels = channels.filter((channel) => channel)
return await Promise.all(
channels
.filter((channel) => channel)
.map((channel) => limit(async () => await suspendChannel(channel)))
existingChannels.map((channel) => limit(async () => await suspendChannel(channel)))
)
})
}
Expand Down Expand Up @@ -528,10 +527,9 @@ export const verifyChannelService = async (em: EntityManager, channelIds: string
}

const limit = pLimit(5) // Limit to 5 concurrent promises
const existingChannels = channels.filter((channel) => channel)
return await Promise.all(
channels
.filter((channel) => channel)
.map((channel) => limit(async () => await verifyChannel(channel)))
existingChannels.map((channel) => limit(async () => await verifyChannel(channel)))
)
})
}
Loading