Skip to content

Conversation

@KirCute
Copy link
Member

@KirCute KirCute commented Nov 11, 2025

Description / 描述

添加一个按钮用于手动触发指定路径下所有子路径的ObjsUpdateHook,这将触发索引更新以及strm驱动的生成本地文件功能。

添加一个设置选项,开启时支持在复制或移动任务完成后自动触发目标路径及所有子路径的ObjsUpdateHook

前端:OpenListTeam/OpenList-Frontend#275

Motivation and Context / 背景

How Has This Been Tested? / 测试

测了

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.
    我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
  • I have updated the repository accordingly (If it’s needed).
    我已相应更新了相关仓库(若适用)。

@KirCute KirCute requested review from j2rong4cn and sevxn007 and removed request for sevxn007 November 11, 2025 13:44
@KirCute KirCute marked this pull request as draft November 11, 2025 13:56
@sevxn007
Copy link
Member

如果可以定时执行更好,但是现在openlist里面没有定时任务系统

@KirCute
Copy link
Member Author

KirCute commented Nov 12, 2025

如果可以定时执行更好,但是现在openlist里面没有定时任务系统

有,但扫这个有风控风险,还是手动比较好

@sevxn007
Copy link
Member

如果可以定时执行更好,但是现在openlist里面没有定时任务系统

有,但扫这个有风控风险,还是手动比较好

提供功能 说明风险 让用户自己选择?

@KirCute
Copy link
Member Author

KirCute commented Nov 12, 2025

提供功能 说明风险 让用户自己选择?

加这个定时扫的功能又要建一张表持久化扫描任务,又要做配套的CRUD和备份还原的适配,懒了,不想写。我之前考虑过要不要将来加一个大的定时任务模块进去,如果哪天心情好要加这个功能了把定时扫描一块做了吧

jyxjjj
jyxjjj previously approved these changes Nov 13, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds functionality to manually trigger object update hooks for file system operations, enabling on-demand index updates and STRM driver file generation.

Key Changes:

  • Added manual scan API endpoints (/admin/scan/start, /admin/scan/stop, /admin/scan/progress) to trigger recursive filesystem scanning
  • Introduced new settings HandleHookAfterWriting and HandleHookRateLimit to control automatic hook triggering after write operations
  • Implemented rate-limited recursive directory scanning with concurrent support for virtual paths
  • Extended file operations (Move, Copy, Put, PutURL, ArchiveDecompress) to optionally trigger hooks after completion
  • Updated transfer tasks to support hook handling with configurable rate limiting

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 22 comments.

Show a summary per file
File Description
server/router.go Added new /admin/scan route group with endpoints for starting, stopping, and checking progress of manual scans
server/middlewares/search.go Changed HTTP status code from 500 to 404 for unavailable search functionality
server/handles/scan.go New handler file implementing manual scan endpoints with request/response types
internal/task_group/transfer.go Added hook handling logic to transfer operations with rate limiting support
internal/setting/setting.go Added GetFloat helper function for retrieving float settings
internal/op/recursive_list.go New file implementing recursive directory listing with cancellation and rate limiting
internal/op/fs.go Extended Move, Copy, Put, and PutURL operations to trigger hooks when enabled
internal/op/archive.go Extended ArchiveDecompress to trigger hooks for extracted content
internal/conf/const.go Added configuration constants for hook handling settings
internal/bootstrap/data/setting.go Added default values for new hook-related settings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jyxjjj jyxjjj merged commit 72e2ae1 into OpenListTeam:main Nov 21, 2025
12 checks passed
@KirCute KirCute deleted the feat/manual-scan branch November 24, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants