MCPcopy Index your code
hub / github.com/simstudioai/sim / deleteSchedulesForWorkflow

Function deleteSchedulesForWorkflow

apps/sim/lib/workflows/schedules/deploy.ts:181–203  ·  view source on GitHub ↗
(
  workflowId: string,
  tx: DbOrTx,
  deploymentVersionId?: string
)

Source from the content-addressed store, hash-verified

179 * This should be called within a database transaction during undeploy
180 */
181export async function deleteSchedulesForWorkflow(
182 workflowId: string,
183 tx: DbOrTx,
184 deploymentVersionId?: string
185): Promise<void> {
186 await tx
187 .delete(workflowSchedule)
188 .where(
189 deploymentVersionId
190 ? and(
191 eq(workflowSchedule.workflowId, workflowId),
192 eq(workflowSchedule.deploymentVersionId, deploymentVersionId),
193 isNull(workflowSchedule.archivedAt)
194 )
195 : and(eq(workflowSchedule.workflowId, workflowId), isNull(workflowSchedule.archivedAt))
196 )
197
198 logger.info(
199 deploymentVersionId
200 ? `Deleted schedules for workflow ${workflowId} deployment ${deploymentVersionId}`
201 : `Deleted all schedules for workflow ${workflowId}`
202 )
203}
204
205async function cleanupDeploymentVersion(params: {
206 workflowId: string

Callers 4

deploy.test.tsFile · 0.90
executeUndeployFunction · 0.85
cleanupDeploymentVersionFunction · 0.85

Calls 3

infoMethod · 0.80
deleteMethod · 0.65
eqFunction · 0.50

Tested by

no test coverage detected