task

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CDN1               = "https://ghproxy.com/"
	ArchiveReleaseBase = "https://github.com/wetor/AnimeGoData/releases/download/archive/"
	Subject            = "bolt_sub.zip"
	SubjectDB          = "bolt_sub.db"

	Cron              = "0 0 12 * * 3" // 每周三12点
	MaxModifyTimeHour = 24             // 首次启动时,是否执行任务的最长修改时间
	MinFileSizeKB     = 512            // 首次启动时,是否执行任务的最小文件大小

	RetryNum  = 3  // 失败重试次数
	RetryWait = 60 // 失败重试等待时间,秒
)

Variables

View Source
var (
	DBDir            string
	BangumiCache     api.CacheOpener
	BangumiCacheLock *sync.Mutex
)

Functions

func Init added in v0.6.5

func Init(opts *Options)

Types

type BangumiTask

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

func NewBangumiTask

func NewBangumiTask(parser *cron.Parser) *BangumiTask

func (*BangumiTask) Cron

func (t *BangumiTask) Cron() string

func (*BangumiTask) Name

func (t *BangumiTask) Name() string

func (*BangumiTask) NextTime

func (t *BangumiTask) NextTime() time.Time

func (*BangumiTask) Run

func (t *BangumiTask) Run(force bool)

type JSPluginTask

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

func NewJSPluginTask

func NewJSPluginTask(parser *cron.Parser) *JSPluginTask

func (*JSPluginTask) Cron

func (t *JSPluginTask) Cron() string

func (*JSPluginTask) Name

func (t *JSPluginTask) Name() string

func (*JSPluginTask) NextTime

func (t *JSPluginTask) NextTime() time.Time

func (*JSPluginTask) Run

func (t *JSPluginTask) Run(force bool)

type Options added in v0.6.5

type Options struct {
	DBDir            string
	BangumiCache     api.CacheOpener
	BangumiCacheLock *sync.Mutex
}

type Task added in v0.6.5

type Task interface {
	Cron() string
	NextTime() time.Time
	Name() string
	Run(force bool)
}

type TaskInfo added in v0.6.5

type TaskInfo struct {
	Name  string
	RunAt time.Time
	Cron  string
}

Jump to

Keyboard shortcuts

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