diff options
Diffstat (limited to 'src/feeds.c')
-rw-r--r-- | src/feeds.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/feeds.c b/src/feeds.c index c54ac945..3fb05d14 100644 --- a/src/feeds.c +++ b/src/feeds.c | |||
@@ -75,6 +75,8 @@ iBool isUnread_FeedEntry(const iFeedEntry *d) { | |||
75 | 75 | ||
76 | /*----------------------------------------------------------------------------------------------*/ | 76 | /*----------------------------------------------------------------------------------------------*/ |
77 | 77 | ||
78 | static int requestTimeoutSeconds_FeedJob_ = 10.0f; | ||
79 | |||
78 | struct Impl_FeedJob { | 80 | struct Impl_FeedJob { |
79 | iString url; | 81 | iString url; |
80 | uint32_t bookmarkId; | 82 | uint32_t bookmarkId; |
@@ -104,6 +106,10 @@ static void deinit_FeedJob(iFeedJob *d) { | |||
104 | deinit_String(&d->url); | 106 | deinit_String(&d->url); |
105 | } | 107 | } |
106 | 108 | ||
109 | static iBool isTimedOut_FeedJob_(iFeedJob *d) { | ||
110 | return elapsedSeconds_Time(&d->startTime) > requestTimeoutSeconds_FeedJob_; | ||
111 | } | ||
112 | |||
107 | iDefineTypeConstructionArgs(FeedJob, (const iBookmark *bm), bm) | 113 | iDefineTypeConstructionArgs(FeedJob, (const iBookmark *bm), bm) |
108 | 114 | ||
109 | /*----------------------------------------------------------------------------------------------*/ | 115 | /*----------------------------------------------------------------------------------------------*/ |
@@ -357,6 +363,11 @@ static iThreadResult fetch_Feeds_(iThread *thread) { | |||
357 | delete_FeedJob(work[i]); | 363 | delete_FeedJob(work[i]); |
358 | work[i] = NULL; | 364 | work[i] = NULL; |
359 | } | 365 | } |
366 | else if (isTimedOut_FeedJob_(work[i])) { | ||
367 | /* Maybe we'll get it next time! */ | ||
368 | delete_FeedJob(work[i]); | ||
369 | work[i] = NULL; | ||
370 | } | ||
360 | else { | 371 | else { |
361 | ongoing++; | 372 | ongoing++; |
362 | } | 373 | } |