Skip to content

Commit

Permalink
fix(job): log was too long (closes bleenco#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCyjaneK authored and Porsh33 committed Apr 14, 2022
1 parent d818ad8 commit fc220a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/core/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type (
StartTime *time.Time `json:"startTime"`
EndTime *time.Time `json:"endTime"`
Status string `gorm:"not null;size:20;default:'queued'" json:"status"` // queued | running | passing | failing
Log string `gorm:"size:16777216" json:"-"`
Log string `gorm:"size:16777216" json:"-" sql:"type:longtext"`
Stage string `json:"stage"`
Cache string `json:"cache"`
Build *Build `gorm:"preload:false" json:"build,omitempty"`
Expand Down
3 changes: 3 additions & 0 deletions server/store/job/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ func (s jobStore) Create(job *core.Job) error {
func (s jobStore) Update(job *core.Job) error {
log := []byte(job.Log)

if len(job.Log) > 16777215 {
job.Log = job.Log[0:16777215]
}
err := s.db.Model(job).Updates(map[string]interface{}{
"status": job.Status,
"start_time": job.StartTime,
Expand Down

0 comments on commit fc220a3

Please sign in to comment.