package foodtruck.server;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.inject.Inject;
import com.google.inject.Singleton;

import foodtruck.twitter.TwitterService;

/**
 * @author aviolette@gmail.com
 * @since 10/11/11
 */
@Singleton
public class TweetCacheUpdateServlet  extends HttpServlet implements Runnable {
  private final TwitterService service;

  @Inject
  public TweetCacheUpdateServlet(TwitterService service) {
    this.service = service;
  }

  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    run();
  }

  @Override
  public void run() {
    service.updateTwitterCache();
    service.updateLocationsOfTwitterTrucks();
  }
}
@@ -47,16 +47,81 @@
 ception;
+%0Aimport java.util.logging.Level;%0Aimport java.util.logging.Logger;
 %0A%0Aimport
@@ -547,16 +547,111 @@
 nable %7B%0A
+  private static final Logger log = Logger.getLogger(TweetCacheUpdateServlet.class.getName());%0A
   privat
@@ -961,24 +961,36 @@
 oid run() %7B%0A
+    try %7B%0A  
     service.
@@ -1011,16 +1011,115 @@
 ache();%0A
+    %7D catch (Exception e) %7B%0A      log.log(Level.WARNING, %22Error updating twitter cache%22, e);%0A    %7D%0A
     serv

Fix it so we update the location of the twitter cached trucks even if there is a failure updating the cache.