Skip to content
Snippets Groups Projects
Select Git revision
  • cd5a567bffbb37a6a408f8b48f1cdf1d68e8645e
  • master default protected
  • 1.31
  • 4.38.7
  • 4.38.6
  • 4.38.5
  • 4.38.4
  • 4.38.3
  • 4.38.2
  • 4.38.1
  • 4.38.0
  • 4.37.2
  • 4.37.1
  • 4.37.0
  • 4.36.0
  • 4.35.0
  • 4.34.1
  • 4.34.0
  • 4.33.1
  • 4.33.0
  • 4.32.2
  • 4.32.1
  • 4.32.0
23 results

release.nix

Blame
  • job-log.go 1.37 KiB
    // Copyright 2023 schukai GmbH
    // SPDX-License-Identifier: AGPL-3.0
    
    package jobqueue
    
    import (
    	"gorm.io/gorm"
    	"time"
    )
    
    type JobLog struct {
    	LogID         uint          `gorm:"primarykey;autoIncrement:true" json:"logId"`
    	JobID         JobID         `json:"jobId" gorm:"type:varchar(255);foreignKey:JobID;references:ID"`
    	ProcessID     int           `json:"processId"`
    	StartTime     time.Time     `json:"startTime"`
    	EndTime       time.Time     `json:"endTime"`
    	ExitCode      int           `json:"exitCode"`
    	Result        string        `json:"output" gorm:"type:TEXT"` // Assuming serialized JSON for any type
    	ResourceUsage ResourceUsage `json:"resourceUsage" gorm:"embedded;embeddedPrefix:resource_usage_"`
    	IO            IO            `json:"io" gorm:"embedded;embeddedPrefix:io_"`
    	ErrorMsg      string        `json:"errorMsg"`
    	IsSuccessful  bool          `json:"isSuccessful"`
    
    	CreatedAt time.Time      `gorm:"column:created_at" json:"createdAt" yaml:"createdAt"`
    	UpdatedAt time.Time      `gorm:"column:updated_at" json:"updatedAt" yaml:"updatedAt"`
    	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index" json:"-" yaml:"-"`
    }
    
    type ResourceUsage struct {
    	Memory uint64  `json:"memory"`
    	CPU    float64 `json:"cpu"`
    }
    
    type IO struct {
    	Disk    int64 `json:"disk"`
    	Network int64 `json:"network"`
    }
    
    func (JobLog) TableName() string {
    	return globalTableNamePrefix + "job_logs"
    }