Author: jflesch
Date: 2007-07-29 15:13:47 +0000 (Sun, 29 Jul 2007)
New Revision: 14423
Modified:
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoard.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKDraft.java
Log:
MiniFrost: Try to send the messages asap instead of at the end of the board
refresh
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoard.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoard.java
2007-07-29 01:46:07 UTC (rev 14422)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoard.java
2007-07-29 15:13:47 UTC (rev 14423)
@@ -310,7 +310,12 @@
private KSKMessage runningDownloads[] = new
KSKMessage[MAX_DOWNLOADS_AT_THE_SAME_TIME];
- protected Date getMidnight(Date date) {
+ protected Date getCurrentlyRefreshedDate() {
+ return lastDate;
+ }
+
+
+ protected static Date getMidnight(Date date) {
Calendar cal = new java.util.GregorianCalendar();
cal.setTime(date);
cal.set(Calendar.HOUR_OF_DAY, 0);
@@ -466,10 +471,11 @@
startNewMessageDownload();
return;
- }
+ } else {
+ /* we notify a change anyway because of
KSKDraft */
+ notifyChange();
-
- if (!successful) { /* if not successful, we look if all
the other failed */
+ /* if not successful, we look if all the other
failed */
/* we look first if we can restart some of the
failed transfers
* up to lastSuccessfulRev +
MAX_FAILURES_IN_A_ROW */
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKDraft.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKDraft.java
2007-07-29 01:46:07 UTC (rev 14422)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKDraft.java
2007-07-29 15:13:47 UTC (rev 14423)
@@ -167,10 +167,20 @@
}
+ private boolean isBoardUpToDateForToday() {
+ if (!board.isRefreshing()
+ ||
(KSKBoard.getMidnight(board.getCurrentlyRefreshedDate()).getTime()
+ < KSKBoard.getMidnight(date).getTime()) ) {
+ return true;
+ }
+ return false;
+ }
+
+
public void update(Observable o, Object param) {
if (o instanceof Board) {
synchronized(board) {
- if (fileToInsert == null ||
board.isRefreshing())
+ if (fileToInsert == null ||
!isBoardUpToDateForToday())
return;
revUsed = board.getNextNonDownloadedRev(date,
-1);
}