You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/models
sillyguodong f5c7d4cfdd
Reduce unnecessary DB queries for Actions tasks (#25199)
Close #24544

Changes:

- Create `action_tasks_version` table to store the latest version of
each scope (global, org and repo).
- When a job with the status of `waiting` is created, the tasks version
of the scopes it belongs to will increase.
- When the status of a job already in the database is updated to
`waiting`, the tasks version of the scopes it belongs to will increase.
- On Gitea side, in `FeatchTask()`, will try to query the
`action_tasks_version` record of the scope of the runner that call
`FetchTask()`. If the record does not exist, will insert a row. Then,
Gitea will compare the version passed from runner to Gitea with the
version in database, if inconsistent, try pick task. Gitea always
returns the latest version from database to the runner.

Related:

- Protocol: https://gitea.com/gitea/actions-proto-def/pulls/10
- Runner: https://gitea.com/gitea/act_runner/pulls/219
2 years ago
..
actions Reduce unnecessary DB queries for Actions tasks (#25199) 2 years ago
activities Add context parameter to some database functions (#26055) 2 years ago
admin Replace `interface{}` with `any` (#25686) 2 years ago
asymkey Update tool dependencies, lock govulncheck and actionlint (#25655) 2 years ago
auth Upgrade go dependencies (#25819) 2 years ago
avatars Avoid warning for system setting when start up (#23054) 2 years ago
db Replace `interface{}` with `any` (#25686) 2 years ago
dbfs Fix content holes in Actions task logs file (#25560) 2 years ago
fixtures Fix incorrect oldest sort in project list (#25806) 2 years ago
git Remove commit status running and warning to align GitHub (#25839) 2 years ago
issues Add context parameter to some database functions (#26055) 2 years ago
migrations Reduce unnecessary DB queries for Actions tasks (#25199) 2 years ago
organization Remove unused code (#25734) 2 years ago
packages Test if container blob is accessible before mounting (#22759) 2 years ago
perm some less naked returns (#25682) 2 years ago
project Fix incorrect oldest sort in project list (#25806) 2 years ago
pull refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo For API attachments, use API URL (#25639) 2 years ago
secret Support configuration variables on Gitea Actions (#24724) 2 years ago
shared/types Display owner of a runner as a tooltip instead of static text (#24377) 2 years ago
system Replace `interface{}` with `any` (#25686) 2 years ago
unit Rewrite logger system (#24726) 2 years ago
unittest Replace `interface{}` with `any` (#25686) 2 years ago
user Fix inconsistent user profile layout across tabs (#25625) 2 years ago
webhook Replace `interface{}` with `any` (#25686) 2 years ago
error.go Sync branches into databases (#22743) 2 years ago
fixture_generation.go Implement FSFE REUSE for golang files (#21840) 2 years ago
fixture_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
main_test.go Merge setting.InitXXX into one function with options (#24389) 2 years ago
migrate.go Add context parameter to some database functions (#26055) 2 years ago
migrate_test.go Add context parameter to some database functions (#26055) 2 years ago
org.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
org_team.go Remove org users who belong to no teams (#24247) 2 years ago
org_team_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
org_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo.go Update tool dependencies, lock govulncheck and actionlint (#25655) 2 years ago
repo_collaboration.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo_collaboration_test.go Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 2 years ago
repo_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_transfer.go Fix unclear `IsRepositoryExist` logic (#24374) 2 years ago
repo_transfer_test.go Rename almost all Ctx functions (#22071) 2 years ago