diff options
Diffstat (limited to 'org/madore/damlengine/WeblogSummary.java')
-rw-r--r-- | org/madore/damlengine/WeblogSummary.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/org/madore/damlengine/WeblogSummary.java b/org/madore/damlengine/WeblogSummary.java index b067987..4f560e8 100644 --- a/org/madore/damlengine/WeblogSummary.java +++ b/org/madore/damlengine/WeblogSummary.java @@ -30,6 +30,7 @@ public final class WeblogSummary { } public HashMap<Integer,EntrySummary> entries; + private long obtainedTime; private static WeblogSummary singleton; @@ -37,11 +38,13 @@ public final class WeblogSummary { this.entries = new HashMap<Integer,EntrySummary>(); } - public static synchronized WeblogSummary getSummary() { - if ( singleton != null ) + public static synchronized WeblogSummary getSummary(Context.DynamicContext dc) { + if ( singleton != null + && ( dc == null || singleton.obtainedTime < dc.modTime ) ) return singleton; singleton = new WeblogSummary(); try { + singleton.obtainedTime = System.currentTimeMillis(); final Connection conn = WeblogDatabaseConnection.getConnection(); final PreparedStatement selSt = conn.prepareStatement("SELECT id , edate , lang , title , title_xml , do_single_page FROM entries"); |