MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / getConnectionStats

Function getConnectionStats

packages/web/src/actions.ts:283–317  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

281)
282
283export const getConnectionStats = async () => sew(() =>
284 withAuth(async ({ org, prisma }) => {
285 const [
286 numberOfConnections,
287 numberOfConnectionsWithFirstTimeSyncJobsInProgress,
288 ] = await Promise.all([
289 prisma.connection.count({
290 where: {
291 orgId: org.id,
292 }
293 }),
294 prisma.connection.count({
295 where: {
296 orgId: org.id,
297 syncedAt: null,
298 syncJobs: {
299 some: {
300 status: {
301 in: [
302 ConnectionSyncJobStatus.PENDING,
303 ConnectionSyncJobStatus.IN_PROGRESS,
304 ]
305 }
306 }
307 }
308 }
309 })
310 ]);
311
312 return {
313 numberOfConnections,
314 numberOfConnectionsWithFirstTimeSyncJobsInProgress,
315 };
316 })
317);
318
319export const getRepoInfoByName = async (repoName: string) => sew(() =>
320 withOptionalAuth(async ({ org, prisma }) => {

Callers 2

DefaultSidebarFunction · 0.90
getSidebarNavGroupsFunction · 0.90

Calls 2

sewFunction · 0.90
withAuthFunction · 0.90

Tested by

no test coverage detected