Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • v1.0.0
  • v1.0.1
  • v1.1.0
  • v1.10.0
  • v1.10.1
  • v1.10.2
  • v1.11.0
  • v1.12.0
  • v1.12.1
  • v1.12.2
  • v1.12.3
  • v1.12.4
  • v1.12.5
  • v1.12.6
  • v1.12.7
  • v1.12.8
  • v1.13.0
  • v1.13.1
  • v1.13.2
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.15.10
  • v1.15.11
  • v1.15.12
  • v1.15.13
  • v1.15.14
  • v1.15.15
  • v1.15.16
  • v1.15.17
  • v1.15.2
  • v1.15.3
  • v1.15.4
  • v1.15.5
  • v1.15.6
  • v1.15.7
  • v1.15.8
  • v1.15.9
  • v1.16.0
  • v1.16.1
  • v1.17.0
  • v1.18.0
  • v1.18.1
  • v1.18.2
  • v1.19.0
  • v1.19.1
  • v1.19.2
  • v1.19.3
  • v1.19.4
  • v1.2.0
  • v1.20.0
  • v1.20.1
  • v1.20.2
  • v1.20.3
  • v1.21.0
  • v1.21.1
  • v1.22.0
  • v1.23.0
  • v1.23.1
  • v1.23.2
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.6.1
  • v1.7.0
  • v1.7.1
  • v1.7.2
  • v1.7.3
  • v1.8.0
  • v1.8.1
  • v1.9.0
76 results

Target

Select target project
  • oss/libraries/go/services/job-queues
1 result
Select Git revision
  • master
  • v1.0.0
  • v1.0.1
  • v1.1.0
  • v1.10.0
  • v1.10.1
  • v1.10.2
  • v1.11.0
  • v1.12.0
  • v1.12.1
  • v1.12.2
  • v1.12.3
  • v1.12.4
  • v1.12.5
  • v1.12.6
  • v1.12.7
  • v1.12.8
  • v1.13.0
  • v1.13.1
  • v1.13.2
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.15.10
  • v1.15.11
  • v1.15.12
  • v1.15.13
  • v1.15.14
  • v1.15.15
  • v1.15.16
  • v1.15.17
  • v1.15.2
  • v1.15.3
  • v1.15.4
  • v1.15.5
  • v1.15.6
  • v1.15.7
  • v1.15.8
  • v1.15.9
  • v1.16.0
  • v1.16.1
  • v1.17.0
  • v1.18.0
  • v1.18.1
  • v1.18.2
  • v1.19.0
  • v1.19.1
  • v1.19.2
  • v1.19.3
  • v1.19.4
  • v1.2.0
  • v1.20.0
  • v1.20.1
  • v1.20.2
  • v1.20.3
  • v1.21.0
  • v1.21.1
  • v1.22.0
  • v1.23.0
  • v1.23.1
  • v1.23.2
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.6.1
  • v1.7.0
  • v1.7.1
  • v1.7.2
  • v1.7.3
  • v1.8.0
  • v1.8.1
  • v1.9.0
76 results
Show changes
Commits on Source (1)
......@@ -6,20 +6,20 @@ import (
)
type JobLog struct {
LogID uint `gorm:"primarykey;autoIncrement:true" json:"log_id"`
JobID JobID `json:"job_id" gorm:"type:varchar(255);foreignKey:JobID;references:ID"`
ProcessID int `json:"process_id"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
ExitCode int `json:"exit_code"`
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:"resource_usage" gorm:"embedded;embeddedPrefix:resource_usage_"`
ResourceUsage ResourceUsage `json:"resourceUsage" gorm:"embedded;embeddedPrefix:resource_usage_"`
IO IO `json:"io" gorm:"embedded;embeddedPrefix:io_"`
ErrorMsg string `json:"error_msg"`
IsSuccessful bool `json:"is_successful"`
ErrorMsg string `json:"errorMsg"`
IsSuccessful bool `json:"isSuccessful"`
CreatedAt time.Time `gorm:"column:created_at" json:"created_at" yaml:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at" yaml:"updated_at"`
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:"-"`
}
......
......@@ -7,14 +7,14 @@ import (
// important: if you want to add fields to this struct, you have to add them to the ResetStats() method as well
type JobStats struct {
JobID JobID `json:"job_id" gorm:"primaryKey"`
RunCount int `json:"run_count"`
SuccessCount int `json:"success_count"`
ErrorCount int `json:"error_count"`
TimeMetrics TimeMetrics `json:"time_metrics" gorm:"embedded;embeddedPrefix:time_metrics_"`
JobID JobID `json:"jobId" gorm:"primaryKey"`
RunCount int `json:"runCount"`
SuccessCount int `json:"successCount"`
ErrorCount int `json:"errorCount"`
TimeMetrics TimeMetrics `json:"timeMetrics" gorm:"embedded;embeddedPrefix:time_metrics_"`
CreatedAt time.Time `gorm:"column:created_at" json:"created_at" yaml:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at" yaml:"updated_at"`
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:"-"`
}
......
......@@ -481,12 +481,30 @@ func (m *Manager) SetLogger(logger Logger) *Manager {
return m
}
// GetLogger returns the logger
func (m *Manager) GetLogger() Logger {
m.mu.Lock()
defer m.mu.Unlock()
return m.logger
}
// RunJob runs a job immediately and does not schedule it
func (m *Manager) RunJob(job GenericJob) error {
m.mu.Lock()
defer m.mu.Unlock()
if m.state != ManagerStateRunning {
return ErrManagerNotRunning
}
if !job.IsPaused() {
m.eventBus.Publish(QueueJob, job)
}
return nil
}
// ScheduleJob schedules a job
func (m *Manager) ScheduleJob(job GenericJob, scheduler Scheduler) error {
m.mu.Lock()
......
......@@ -30,8 +30,8 @@ type JobPersistence struct {
Logs []JobLog `gorm:"foreignKey:JobID;references:ID" json:"-" yaml:"-"`
Stats JobStats `gorm:"foreignKey:JobID" json:"stats" yaml:"stats"`
CreatedAt time.Time `gorm:"column:created_at" json:"created_at" yaml:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at" yaml:"updated_at"`
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:"-"`
}
......