1
1
mirror of https://github.com/go-gitea/gitea synced 2025-11-01 11:58:25 +00:00

chore(runner): add soft deleted field

This commit is contained in:
Bo-Yi Wu
2022-10-12 14:37:57 +08:00
committed by Jason Song
parent 9648482ed6
commit 699f5c5a06
8 changed files with 14 additions and 19 deletions

View File

@@ -81,15 +81,15 @@ func (r *Run) LoadAttributes(ctx context.Context) error {
// InsertRun inserts a bot run
func InsertRun(run *Run, jobs []*jobparser.SingleWorkflow) error {
var groupId int64
var groupID int64
{
// tricky way to get resource group id
h := fnv.New64()
_, _ = h.Write([]byte(fmt.Sprintf("%d_%s", run.RepoID, run.WorkflowID)))
groupId = int64(h.Sum64())
groupID = int64(h.Sum64())
}
index, err := db.GetNextResourceIndex("bots_run_index", groupId)
index, err := db.GetNextResourceIndex("bots_run_index", groupID)
if err != nil {
return err
}