feat: optimize log indexes

This commit is contained in:
Jason Song
2022-10-18 17:17:58 +08:00
parent bb4963fd4a
commit dd5b2c5dfd
7 changed files with 59 additions and 25 deletions

View File

@ -94,17 +94,20 @@ func addBotTables(x *xorm.Engine) error {
type BotsRunIndex db.ResourceIndex
type BotsTask struct {
ID int64
JobID int64
Attempt int64
RunnerID int64 `xorm:"index"`
LogToFile bool // read log from database or from storage
LogURL string // url of the log file in storage
Result int32
Started timeutil.TimeStamp
Stopped timeutil.TimeStamp
Created timeutil.TimeStamp `xorm:"created"`
Updated timeutil.TimeStamp `xorm:"updated"`
ID int64
JobID int64
Attempt int64
RunnerID int64 `xorm:"index"`
Result int32
Started timeutil.TimeStamp
Stopped timeutil.TimeStamp
LogURL string // dbfs:///a/b.log or s3://endpoint.com/a/b.log and etc.
LogLength int64 // lines count
LogSize int64 // blob size
LogIndexes *[]int64 `xorm:"BLOB"` // line number to offset
LogExpired bool
Created timeutil.TimeStamp `xorm:"created"`
Updated timeutil.TimeStamp `xorm:"updated"`
}
type BotsTaskStep struct {