Changeset 68
- Timestamp:
- 11/12/05 23:22:41 (5 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
feedtree/trunk/src/net/feedtree/proxyapp/FeedInfo.java
r40 r68 232 232 protected SyndFeedOutput m_feedOutput = new SyndFeedOutput(); 233 233 protected Exception m_errno; 234 protected int m_errCount; 234 235 protected Date m_nextTaskDate; 235 236 protected Date m_lastTaskDate; … … 344 345 Exception err = m_errno; 345 346 m_errno = null; 347 m_errCount = 0; 346 348 return err; 349 } 350 351 protected void setFeedException(Exception e) { 352 m_errno = e; 353 m_errCount++; 354 } 355 356 protected void clearFeedException() { 357 m_errno = null; 358 m_errCount = 0; 347 359 } 348 360 349 361 public Exception peekLastException() { 350 362 return m_errno; 363 } 364 365 public int peekLastExceptionCount() { 366 return m_errCount; 351 367 } 352 368 … … 493 509 494 510 if (newEvent) newEntries.add(event); 511 512 clearFeedException(); 495 513 } catch (com.sun.syndication.io.FeedException exc) { 496 514 // not much we can do---the thing doesn't generate. 497 515 Logger.global.warning("Couldn't convert SyndEntry (" + entry + ") to IFeedEvent: " + exc); 498 m_errno = exc;516 setFeedException(exc); 499 517 } 500 518 } … … 527 545 // Observer: WebProxyClient. 528 546 // Note: if newEvents.size() == 0, a heartbeat will be generated 547 548 clearFeedException(); 549 529 550 } catch (Exception e) { 530 551 Logger.global.warning(">> Couldn't fetch feed " + m_uri + ": " + e); 531 552 e.printStackTrace(System.out); 532 553 533 m_errno = e;554 setFeedException(e); 534 555 // will result in an RSS item for the user explaining the 535 556 // exception feedtree/trunk/src/net/feedtree/proxyapp/WebProxyClient.java
r67 r68 57 57 58 58 public static long DEFAULT_STALE_FEED_AGE = 7 * DAYS; 59 60 // Number of times an exception must be raised in sequence before it's 61 // reported to the user as a fake RSS item 62 public static int TRANSIENT_EXCEPTION_THRESH = 2; 59 63 60 64 public static String FEEDTREE_CLIENT_FEED_TYPE = "atom_0.3"; … … 382 386 SyndFeed generatedFeed = feed.generateSyndFeed(WebProxyClient.FEED_SIZE, m_appendEntryInfo); 383 387 384 if (feed.peekLastException() != null) { 388 if (feed.peekLastException() != null 389 && feed.peekLastExceptionCount() >= TRANSIENT_EXCEPTION_THRESH) 390 { 385 391 ListIterator iter = generatedFeed.getEntries().listIterator(); 386 392
