0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-27 18:04:04 -05:00
forgejo/models/migrations
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
2023-07-24 06:11:27 +00:00
..
base Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
fixtures Remove wrongly added column on migration test fixtures (#23456) 2023-03-14 19:49:59 +08:00
v1_6 Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
v1_7 Update go dev dependencies (#22064) 2022-12-08 16:21:37 +08:00
v1_8 Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
v1_9 Update go dev dependencies (#22064) 2022-12-08 16:21:37 +08:00
v1_10 Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
v1_11 Less naked returns (#25713) 2023-07-07 05:31:56 +00:00
v1_12 Refactor setting.Database.UseXXX to methods (#23354) 2023-03-07 18:51:06 +08:00
v1_13 Less naked returns (#25713) 2023-07-07 05:31:56 +00:00
v1_14 Update tool dependencies, lock govulncheck and actionlint (#25655) 2023-07-09 11:58:06 +00:00
v1_15 Less naked returns (#25713) 2023-07-07 05:31:56 +00:00
v1_16 Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
v1_17 Drop migration for ForeignReference (#23605) 2023-03-23 15:01:55 -04:00
v1_18 Refactor setting.Database.UseXXX to methods (#23354) 2023-03-07 18:51:06 +08:00
v1_19 Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
v1_20 Redesign Scoped Access Tokens (#24767) 2023-06-04 20:57:16 +02:00
v1_21 Reduce unnecessary DB queries for Actions tasks (#25199) 2023-07-24 06:11:27 +00:00
migrations.go Reduce unnecessary DB queries for Actions tasks (#25199) 2023-07-24 06:11:27 +00:00