Source File
cron_job.go
Belonging Package
github.com/limanmys/render-engine/app/models
package models
import (
)
type CronJob struct {
ID *uuid.UUID `json:"id" gorm:"primary_key,type:uuid"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ExtensionID *uuid.UUID `json:"extension_id"`
UserID *uuid.UUID `json:"user_id"`
ServerID *uuid.UUID `json:"server_id"`
BaseURL string `json:"base_url"`
Payload string `json:"payload"`
Day int `json:"day"`
Time string `json:"time"`
Target string `json:"target"`
Message string `json:"message"` // Last run message
Status Status `json:"status"` // Last run status
Output string `json:"output"` // Last run output
}
func (CronJob) () string {
return "cronjobs"
}
func () *CronJob {
:= uuid.New()
return &CronJob{
ID: &,
Message: "Pending.",
Status: StatusPending,
}
}
func ( *CronJob) () {
.Status = StatusProcessing
.Message = "Cronjob processing."
.Output = "-"
database.Connection().Model().Save()
}
func ( *CronJob) ( string) {
.Status = StatusFailed
.Message =
database.Connection().Model().Save()
}
func ( *CronJob) ( string) {
.Status = StatusDone
.Output =
.Message = "CronJob completed successfully. Waiting for next run."
database.Connection().Model().Save()
}
![]() |
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |