We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e20edb4 commit 88b0c7aCopy full SHA for 88b0c7a
utils/fetch.js
@@ -12,6 +12,7 @@ const {
12
getFeedByUrl,
13
resetErrorCount
14
} = require('../proxies/rssFeed');
15
+const { notify_error_count } = require('../config');
16
17
const fetch = async (feedUrl) => {
18
try {
@@ -29,7 +30,11 @@ const fetch = async (feedUrl) => {
29
30
} catch (e) {
31
await failAttempt(feedUrl);
32
getFeedByUrl(feedUrl).then((feed) => {
- if (feed.error_count >= 5) {
33
+ const round_time = notify_error_count * 10;
34
+ const round_happen =
35
+ feed.error_count % round_time === 0 &&
36
+ feed.error_count > round_time;
37
+ if (feed.error_count === notify_error_count || round_happen) {
38
logger.info(feed, 'ERROR_MANY_TIME');
39
process.send({
40
success: false,
0 commit comments