jobs

package
v0.0.0-...-0c2bc9e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobNameUserCsvImport = "UserCsvImport"
	JobNameDatabaseReset = "DatabaseReset"
)

Variables

View Source
var (
	ErrItemSkip = errors.New("item skip")
)

Functions

func CleanOutdatedJobs

func CleanOutdatedJobs()

------------------------------------ CleanOutdatedJobs iterate schemas to clean outdated jobs

func Reappend

func Reappend()

------------------------------------

func Start

func Start()

Job start

Types

type ArgFilter

type ArgFilter struct {
	Start time.Time `form:"start" json:"start,omitempty"`
	End   time.Time `form:"end" json:"end,omitempty"`
	Items int       `form:"items" json:"items,omitempty"`
}

func (*ArgFilter) Bind

func (af *ArgFilter) Bind(c *xin.Context, a any) error

type ArgLocale

type ArgLocale struct {
	Locale string `json:"locale,omitempty"`
}

type DatabaseResetArg

type DatabaseResetArg ArgLocale

type DatabaseReseter

type DatabaseReseter struct {
	*JobRunner
	// contains filtered or unexported fields
}

func NewDatabaseReseter

func NewDatabaseReseter(tt tenant.Tenant, job *xjm.Job) *DatabaseReseter

func (*DatabaseReseter) Run

func (dr *DatabaseReseter) Run()

type ItemSkip

type ItemSkip struct {
	ID     int64  `json:"id"`
	Title  string `json:"title"`
	Reason string `json:"reason"`
}

func (*ItemSkip) String

func (is *ItemSkip) String() string

type JobResult

type JobResult struct {
	Skips []*ItemSkip `json:"skips,omitempty"`
}

func (*JobResult) AddSkipItem

func (jr *JobResult) AddSkipItem(id int64, title, reason string)

func (*JobResult) SkipInfo

func (jr *JobResult) SkipInfo() string

func (*JobResult) String

func (jr *JobResult) String() string

type JobRunner

type JobRunner struct {
	*xjm.JobRunner

	Tenant tenant.Tenant
}

type JobState

type JobState struct {
	JobStep
	LastID int64 `json:"last_id,omitempty"`
}

func (*JobState) String

func (js *JobState) String() string

type JobStep

type JobStep struct {
	Step  int `json:"step,omitempty"`
	Total int `json:"total,omitempty"`
}

func (*JobStep) StepInfo

func (js *JobStep) StepInfo() string

func (*JobStep) String

func (js *JobStep) String() string

type TenantJobs

type TenantJobs struct {
	// contains filtered or unexported fields
}

func NewTenantJobs

func NewTenantJobs() *TenantJobs

func (*TenantJobs) Add

func (tj *TenantJobs) Add(tt tenant.Tenant, job *xjm.Job)

func (*TenantJobs) Count

func (tj *TenantJobs) Count(tt tenant.Tenant) int

func (*TenantJobs) Del

func (tj *TenantJobs) Del(tt tenant.Tenant, job *xjm.Job)

func (*TenantJobs) Stats

func (tj *TenantJobs) Stats() string

func (*TenantJobs) Total

func (tj *TenantJobs) Total() int

type UserCsvImportArg

type UserCsvImportArg ArgLocale

type UserCsvImporter

type UserCsvImporter struct {
	*JobRunner

	JobStep
	// contains filtered or unexported fields
}

func NewUserCsvImporter

func NewUserCsvImporter(tt tenant.Tenant, job *xjm.Job) *UserCsvImporter

func (*UserCsvImporter) Run

func (uci *UserCsvImporter) Run()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL