Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/sim/app/api/environment/route.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ import { AuditAction, AuditResourceType, recordAudit } from '@sim/audit'
import { db } from '@sim/db'
import { environment } from '@sim/db/schema'
import { createLogger } from '@sim/logger'
import { toError } from '@sim/utils/errors'
import { generateId } from '@sim/utils/id'
import { eq } from 'drizzle-orm'
import { type NextRequest, NextResponse } from 'next/server'
Expand DownExpand Up@@ -136,8 +137,8 @@ export const GET = withRouteHandler(async (request: Request) => {
>

return NextResponse.json({ data: decryptedVariables }, { status: 200 })
} catch (error: any) {
} catch (error) {
logger.error(`[${requestId}] Environment fetch error`, error)
return NextResponse.json({ error: error.message }, { status: 500 })
return NextResponse.json({ error: toError(error).message }, { status: 500 })
}
})
4 changes: 2 additions & 2 deletions apps/sim/app/api/schedules/[id]/route.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -135,7 +135,7 @@ export const PUT = withRouteHandler(

await db
.update(workflowSchedule)
.set({ status: 'disabled', nextRunAt: null, updatedAt: new Date() })
.set({ status: 'disabled', nextRunAt: null, lastQueuedAt: null, updatedAt: new Date() })
.where(and(eq(workflowSchedule.id, scheduleId), isNull(workflowSchedule.archivedAt)))

logger.info(`[${requestId}] Disabled schedule: ${scheduleId}`)
Expand DownExpand Up@@ -220,7 +220,7 @@ export const PUT = withRouteHandler(

await db
.update(workflowSchedule)
.set({ status: 'active', failedCount: 0, updatedAt: now, nextRunAt })
.set({ status: 'active', failedCount: 0, infraRetryCount: 0, updatedAt: now, nextRunAt })
.where(and(eq(workflowSchedule.id, scheduleId), isNull(workflowSchedule.archivedAt)))

logger.info(`[${requestId}] Reactivated schedule: ${scheduleId}`)
Expand Down
Loading
Loading