Skip to content

Update delete operation to refresh scheduler#21

Closed
DeAthBo wants to merge 2 commits intoSoulter:masterfrom
DeAthBo:DeAthBo-patch-1
Closed

Update delete operation to refresh scheduler#21
DeAthBo wants to merge 2 commits intoSoulter:masterfrom
DeAthBo:DeAthBo-patch-1

Conversation

@DeAthBo
Copy link

@DeAthBo DeAthBo commented Jan 12, 2026

Bug Fix: Fix remove_job() missing job_id parameter

Issue

When executing /rss rsshub remove <idx> command, the following error occurs:

BaseScheduler.remove_job() missing 1 required positional argument: 'job_id'

Root Cause

In the rsshub_remove function (line 412), self.scheduler.remove_job() was called without the required job_id parameter.

Solution

Replaced the incorrect remove_job() call with self._fresh_asyncIOScheduler(), which is the same approach used in the remove_command function. This method refreshes all scheduled tasks after removing the endpoint from the data store.

Changes

  • Removed: self.scheduler.remove_job()
  • Added: self._fresh_asyncIOScheduler()
  • Updated comment for clarity

Refactor job removal and data handling in delete operation.
main.py Outdated
# TODO:删除对应的定时任务
self.scheduler.remove_job()
self.data_handler.data["rsshub_endpoints"].pop(idx)
# 刷新定时任务 self._fresh_asyncIOScheduler() self.data_handler.data["rsshub_endpoints"].pop(idx)
Copy link
Owner

Choose a reason for hiding this comment

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

代码被注释掉了?

Copy link
Author

Choose a reason for hiding this comment

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

已修复!之前注释、函数调用和数据操作都被挤在了同一行,导致代码看起来像被注释掉了。现在已经分成三行,代码格式正确了。

The comment, function call, and data operation were all on the same line, which made the code appear commented out. This fix separates them into three distinct lines for better readability and to address the review feedback.
@DeAthBo DeAthBo closed this by deleting the head repository Mar 6, 2026
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.

2 participants