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
2 changes: 1 addition & 1 deletion src/components/tasks-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const searchHandler: ((value: string) => void) | undefined =
/>
</div>
</TableHead>
<TableHead> Worker </TableHead>
<TableHead> Broker </TableHead>
</TableRow>
</TableHeader>
<TableBody>
Expand Down
20 changes: 10 additions & 10 deletions src/server/api/tasks/[id]/started.post.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {
taskRouteParamsSchema,
taskStartedRequestSchema,
} from "../../../schemas/tasks"
import { tasksRepository } from "../../../repositories/tasks"
import { envVariables } from "~/server/env"
taskStartedRequestSchema
} from '../../../schemas/tasks'
import { tasksRepository } from '../../../repositories/tasks'
import { envVariables } from '~/server/env'

export default defineEventHandler(async (event) => {
const accessToken = getRequestHeader(event, "access-token")
const accessToken = getRequestHeader(event, 'access-token')
if (!accessToken || accessToken !== envVariables.taskiqAdminApiToken) {
throw createError({
status: 401,
statusMessage: "Unauthorized",
message: "Invalid access token",
statusMessage: 'Unauthorized',
message: 'Invalid access token'
})
}
const params = await getValidatedRouterParams(
Expand All @@ -24,15 +24,15 @@ export default defineEventHandler(async (event) => {
finishedAt: null,
returnValue: null,
executionTime: null,
state: "running",
state: 'running',
args: body.args,
id: params.id,
worker: body.worker,
kwargs: body.kwargs,
name: body.taskName,
startedAt: body.startedAt,
startedAt: body.startedAt
})
return {
success: true,
success: true
}
})
2 changes: 1 addition & 1 deletion src/server/repositories/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ class TasksRepository {
async create(values: {
id: string
name: string
worker: string
startedAt: Date
args: Array<any>
worker: string | null
finishedAt: Date | null
kwargs: Record<string, any>
executionTime: number | null
Expand Down
2 changes: 1 addition & 1 deletion src/server/schemas/tasks.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { z } from 'zod'

export const taskStartedRequestSchema = z.object({
worker: z.string(),
taskName: z.string(),
startedAt: z.coerce.date(),
args: z.array(z.unknown()),
worker: z.string().nullable(),
kwargs: z.record(z.string(), z.unknown())
})

Expand Down