mirror of
https://github.com/feeddeck/feeddeck.git
synced 2026-03-12 01:54:51 -05:00
[nitter] Disable Adding of new Sources (#163)
This commit disables the adding of new Nitter sources, because Nitter is deprecated 😞 and adding new sources is not working anymore. Nitter sources are also not updated anymore, because the update for Nitter sources isn't working as well. To ensure that the Nitter sources are not updated anymore the sources with type `nitter` are skipped in the scheduler. The Nitter source isn't removed completly, because we would also have to cleanup the database and their might be items, which are bookmarked by users. See https://github.com/zedeus/nitter/issues/1155#issuecomment-1913361757
This commit is contained in:
@@ -148,14 +148,20 @@ const scheduleSources = async (
|
||||
});
|
||||
for (const source of sources) {
|
||||
/**
|
||||
* Skip "reddit" and "nitter" sources for users on the free tier, when
|
||||
* the source was already updated in the last 24 hours. This is done
|
||||
* to avoid hitting the rate limits of the Reddit and Nitter APIs.
|
||||
* The "nitter" source type is deprecated and should not be scheduled
|
||||
* for updates anymore.
|
||||
* See https://github.com/zedeus/nitter/issues/1155#issuecomment-1913361757
|
||||
*/
|
||||
if (
|
||||
profile.tier === 'free' &&
|
||||
(source.type === 'reddit' || source.type === 'nitter')
|
||||
) {
|
||||
if (source.type === 'nitter') {
|
||||
continue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Skip "reddit" sources for users on the free tier, when the source
|
||||
* was already updated in the last 24 hours. This is done to avoid
|
||||
* hitting the rate limits of the Reddit API.
|
||||
*/
|
||||
if (profile.tier === 'free' && source.type === 'reddit') {
|
||||
if (
|
||||
source.updatedAt > Math.floor(new Date().getTime() / 1000) -
|
||||
(60 * 60 * 24)
|
||||
|
||||
Reference in New Issue
Block a user