Reduce unnecessary DB queries for Actions tasks #219

Merged
sillyguodong merged 12 commits from feature/fetch_task_with_index into main 2023-07-25 03:25:52 +00:00
sillyguodong commented 2023-05-29 02:01:44 +00:00 (Migrated from gitea.com)

implement: https://github.com/go-gitea/gitea/issues/24544

Changes:

  • Add a global variable tasksVersion to store the lastest version number which returned by Gitea.
  • Pass tasksVersion to Gitea when invoking FetchTask.
  • If there is no task in the FetchTask response, store the version from the FetchTask response into tasksVersion variable.
  • If there is a task in the FetchTask response, set tasksVersion to zero to focre query db in next FetchTask request.

Related:

implement: https://github.com/go-gitea/gitea/issues/24544 Changes: - Add a global variable `tasksVersion` to store the lastest version number which returned by Gitea. - Pass `tasksVersion` to Gitea when invoking `FetchTask`. - If there is no task in the `FetchTask` response, store the version from the `FetchTask` response into `tasksVersion` variable. - If there is a task in the `FetchTask` response, set `tasksVersion` to zero to focre query db in next `FetchTask` request. Related: - Protocol: https://gitea.com/gitea/actions-proto-def/pulls/10 - Gitea side: https://github.com/go-gitea/gitea/pull/25199
wolfogre (Migrated from gitea.com) reviewed 2023-07-06 07:42:21 +00:00
lunny (Migrated from gitea.com) approved these changes 2023-07-23 14:24:24 +00:00
wolfogre (Migrated from gitea.com) approved these changes 2023-07-25 03:19:53 +00:00
Sign in to join this conversation.