Add /feeds/invalid route to Posts service #2412
Labels
area: microservices
area: redis
Redis Database related
area: web server
Issues related to the web server
type: enhancement
New feature or request
In #2395 we are adding an expanded status service dashboard. One thing I want to include in it is the ability to see a list of all feeds that have been flagged as
invalid
in our system. @joshuali7536 did some work toward making this possible in #2388, and @manekenpix has done some more in #2396 to include the/feeds
endpoint in the Posts service.I'd like to see a new route get added to Posts:
This should return a JSON array of Objects with the feed info as well as the reason why it was invalidated.
Doing so will require an update to how the Redis database code works in https://github.com/Seneca-CDOT/telescope/blob/master/src/backend/utils/storage.js. Currently when we invalidate a feed, we add the
:invalid
suffix to the feed key, and store the reason as its value.Redis supports doing pattern matching on keys using the
SCAN
command withmatch
. You can see an example in JS of what this looks like at https://github.com/luin/ioredis/blob/88b8a3125cd039afdac928c529a1b9958009979c/test/functional/scan_stream.ts#L50-L78. What we'd do is look for all keys like this:We can then use these keys to lookup the actual reason for each invalid feed, which is stored in the value for those keys. We'd use this to return the feed id (and probably URL) along with the reason why this feed was marked invalid.
Later we can use this route to create a widget on the status dashboard with a table of feeds and reasons for being marked invalid.
The text was updated successfully, but these errors were encountered: