feat(server): properly reschedule jobs after polling
This commit is contained in:
parent
c57de4d8ee
commit
0a5c4295e0
2 changed files with 45 additions and 11 deletions
|
|
@ -6,8 +6,8 @@ import web.response { new_data_response, new_response }
|
|||
// import util
|
||||
// import models { BuildLog, BuildLogFilter }
|
||||
|
||||
['/api/v1/builds/poll'; auth; get]
|
||||
fn (mut app App) v1_poll_build_queue() web.Result {
|
||||
['/api/v1/jobs/poll'; auth; get]
|
||||
fn (mut app App) v1_poll_job_queue() web.Result {
|
||||
arch := app.query['arch'] or {
|
||||
return app.json(.bad_request, new_response('Missing arch query arg.'))
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ fn (mut app App) v1_poll_build_queue() web.Result {
|
|||
}
|
||||
max := max_str.int()
|
||||
|
||||
mut out := app.job_queue.pop_n(arch, max)
|
||||
mut out := app.job_queue.pop_n(arch, max).map(it.config)
|
||||
|
||||
return app.json(.ok, new_data_response(out))
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue