Sync branch magefile with main #104308

Merged
Sybren A. Stüvel merged 85 commits from abelli/flamenco:magefile into magefile 2024-05-13 16:26:32 +02:00
2 changed files with 4 additions and 33 deletions
Showing only changes of commit 1ac796d0d8 - Show all commits

View File

@ -17,6 +17,10 @@ INSERT INTO jobs (
)
VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? );
-- name: FetchJob :one
SELECT * FROM jobs
WHERE uuid = ? LIMIT 1;
-- name: DeleteJob :exec
DELETE FROM jobs WHERE uuid = ?;
@ -26,10 +30,3 @@ UPDATE jobs SET
delete_requested_at = @now
WHERE id = sqlc.arg('job_id');
-- name: FetchTask :one
SELECT * FROM tasks
WHERE uuid = ? LIMIT 1;
-- name: FetchJob :one
SELECT * FROM jobs
WHERE uuid = ? LIMIT 1;

View File

@ -95,32 +95,6 @@ func (q *Queries) FetchJob(ctx context.Context, uuid string) (Job, error) {
return i, err
}
const fetchTask = `-- name: FetchTask :one
SELECT id, created_at, updated_at, uuid, name, type, job_id, priority, status, worker_id, last_touched_at, commands, activity FROM tasks
WHERE uuid = ? LIMIT 1
`
func (q *Queries) FetchTask(ctx context.Context, uuid string) (Task, error) {
row := q.db.QueryRowContext(ctx, fetchTask, uuid)
var i Task
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.UUID,
&i.Name,
&i.Type,
&i.JobID,
&i.Priority,
&i.Status,
&i.WorkerID,
&i.LastTouchedAt,
&i.Commands,
&i.Activity,
)
return i, err
}
const requestJobDeletion = `-- name: RequestJobDeletion :exec
UPDATE jobs SET
updated_at = ?1,