task

package
v0.0.0-...-251596f Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RepoCheckout        = "task.repo.checkout"         // 从快照中检出
	RepoAutoPurge       = "task.repo.autoPurge"        // 自动清理数据仓库
	DatabaseIndexFull   = "task.database.index.full"   // 重建索引
	DatabaseIndexFTS    = "task.database.index.fts"    // 重建搜索索引
	DatabaseIndex       = "task.database.index"        // 数据库索引
	DatabaseIndexCommit = "task.database.index.commit" // 数据库索引提交
	DatabaseIndexRef    = "task.database.index.ref"    // 数据库索引引用

	OCRImage                          = "task.ocr.image"                            // 图片 OCR 提取文本
	HistoryGenerateFile               = "task.history.generateFile"                 // 生成文件历史
	HistoryDatabaseIndexFull          = "task.history.database.index.full"          // 历史数据库重建索引
	HistoryDatabaseIndexCommit        = "task.history.database.index.commit"        // 历史数据库索引提交
	DatabaseIndexEmbedBlock           = "task.database.index.embedBlock"            // 数据库索引嵌入块
	ReloadUI                          = "task.reload.ui"                            // 重载 UI
	AssetContentDatabaseIndexFull     = "task.asset.database.index.full"            // 资源文件数据库重建索引
	AssetContentDatabaseIndexCommit   = "task.asset.database.index.commit"          // 资源文件数据库索引提交
	DatabaseIndexEmbeddingFull        = "task.database.index.embedding.full"        // 嵌入向量重建索引
	DatabaseIndexEmbeddingRetryFailed = "task.database.index.embedding.retryFailed" // 嵌入向量重试失败块
	CacheVirtualBlockRef              = "task.cache.virtualBlockRef"                // 缓存虚拟块引用
	ReloadAttributeView               = "task.reload.attributeView"                 // 重新加载属性视图
	ReloadProtyle                     = "task.reload.protyle"                       // 重新加载编辑器
	ReloadTag                         = "task.reload.tag"                           // 重新加载标签面板
	ReloadFiletree                    = "task.reload.filetree"                      // 重新加载文档树面板
	SetRefDynamicText                 = "task.ref.setDynamicText"                   // 设置引用的动态锚文本
	SetDefRefCount                    = "task.def.setRefCount"                      // 设置定义的引用计数
	UpdateIDs                         = "task.update.ids"                           // 更新 ID
	PushMsg                           = "task.push.msg"                             // 推送消息
)

Variables

This section is empty.

Functions

func AppendAsyncTaskWithDelay

func AppendAsyncTaskWithDelay(action string, delay time.Duration, handler any, args ...any)

func AppendTask

func AppendTask(action string, handler any, args ...any)

func AppendTaskWithTimeout

func AppendTaskWithTimeout(action string, timeout time.Duration, handler any, args ...any)

func ContainIndexTask

func ContainIndexTask() bool

func ExecAsyncTaskJob

func ExecAsyncTaskJob()

func ExecTaskJob

func ExecTaskJob()

func StatusJob

func StatusJob()

Types

type Task

type Task struct {
	Action  string
	Handler reflect.Value
	Args    []any
	Created time.Time
	Async   bool // 为 true 说明是异步任务,不会阻塞任务队列,满足 Delay 条件后立即执行
	Delay   time.Duration
	Timeout time.Duration
}

Jump to

Keyboard shortcuts

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