Repository navigation
feat(rss): add pause, resume and list commands with worker lifecycle management - #56
Merged
Merged
Conversation
- Add pause/disable and resume/enable commands to ReplyCommands - Implement SetFeedActiveStatus, PauseFeed and ResumeFeed - Manage per-feed background worker goroutines with context.Context and cancellable backoff timer - Stop running worker immediately when feed is deleted via RemoveFeedFromList - Gracefully stop all feed workers on server shutdown - Add unit tests for worker lifecycle, pause/resume and command permissions
- Add GetFeeds helper to read all configured feeds from database - Implement !rss list command with formatted feed overview - Dynamically resolve Discord channel name from channel ID via session state and API - Add unit tests for GetFeeds and the list command
Contributor
Code coverage overviewLanguages: Go Go / code-coverage/go-test
View coverage of the 2 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
…t-of-bounds read - Add explicit len(parts) < 3 check inside del, pause/disable, and resume/enable - Remove compound pre-switch condition to resolve CodeQL off-by-one warning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR enhances the RSS feed management in GSHBot with pause/resume controls, an overview command, and clean background worker lifecycle management:
1. Pause & Resume (
!rss pause/!rss resume, aliases:disable/enable)activeStatusfield insimple-json-dband the in-memory feed slice thread-safely.context.Contextandgofeed.ParseURLWithContext.!rss del), or server shutdown (rss.StopRSSFeeds()).2. List Command (
!rss list)#news) from channel IDs via the Discord session cache/API.3. Testing & Hygiene
extension/rss/rss_test.goandhandler/messagehandler/replycommands_rss_test.go(100% PASS).go fmtand checked withgo vet.