File tree Expand file tree Collapse file tree 4 files changed +13
-13
lines changed Expand file tree Collapse file tree 4 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ const searchHandler: ((value: string) => void) | undefined =
138
138
/>
139
139
</div >
140
140
</TableHead >
141
- <TableHead > Worker </TableHead >
141
+ <TableHead > Broker </TableHead >
142
142
</TableRow >
143
143
</TableHeader >
144
144
<TableBody >
Original file line number Diff line number Diff line change 1
1
import {
2
2
taskRouteParamsSchema ,
3
- taskStartedRequestSchema ,
4
- } from " ../../../schemas/tasks"
5
- import { tasksRepository } from " ../../../repositories/tasks"
6
- import { envVariables } from " ~/server/env"
3
+ taskStartedRequestSchema
4
+ } from ' ../../../schemas/tasks'
5
+ import { tasksRepository } from ' ../../../repositories/tasks'
6
+ import { envVariables } from ' ~/server/env'
7
7
8
8
export default defineEventHandler ( async ( event ) => {
9
- const accessToken = getRequestHeader ( event , " access-token" )
9
+ const accessToken = getRequestHeader ( event , ' access-token' )
10
10
if ( ! accessToken || accessToken !== envVariables . taskiqAdminApiToken ) {
11
11
throw createError ( {
12
12
status : 401 ,
13
- statusMessage : " Unauthorized" ,
14
- message : " Invalid access token" ,
13
+ statusMessage : ' Unauthorized' ,
14
+ message : ' Invalid access token'
15
15
} )
16
16
}
17
17
const params = await getValidatedRouterParams (
@@ -24,15 +24,15 @@ export default defineEventHandler(async (event) => {
24
24
finishedAt : null ,
25
25
returnValue : null ,
26
26
executionTime : null ,
27
- state : " running" ,
27
+ state : ' running' ,
28
28
args : body . args ,
29
29
id : params . id ,
30
30
worker : body . worker ,
31
31
kwargs : body . kwargs ,
32
32
name : body . taskName ,
33
- startedAt : body . startedAt ,
33
+ startedAt : body . startedAt
34
34
} )
35
35
return {
36
- success : true ,
36
+ success : true
37
37
}
38
38
} )
Original file line number Diff line number Diff line change @@ -71,9 +71,9 @@ class TasksRepository {
71
71
async create ( values : {
72
72
id : string
73
73
name : string
74
- worker : string
75
74
startedAt : Date
76
75
args : Array < any >
76
+ worker : string | null
77
77
finishedAt : Date | null
78
78
kwargs : Record < string , any >
79
79
executionTime : number | null
Original file line number Diff line number Diff line change 1
1
import { z } from 'zod'
2
2
3
3
export const taskStartedRequestSchema = z . object ( {
4
- worker : z . string ( ) ,
5
4
taskName : z . string ( ) ,
6
5
startedAt : z . coerce . date ( ) ,
7
6
args : z . array ( z . unknown ( ) ) ,
7
+ worker : z . string ( ) . nullable ( ) ,
8
8
kwargs : z . record ( z . string ( ) , z . unknown ( ) )
9
9
} )
10
10
You can’t perform that action at this time.
0 commit comments