/webccr/src/com/emis/caesarui/webccr/core/PromotionUpdateThread.java

https://bitbucket.org/sanliou/synccr · Java · 34 lines · 20 code · 10 blank · 4 comment · 0 complexity · dbb00db7d0e52d1e7c4055089bb087ad MD5 · raw file

  1. package com.emis.caesarui.webccr.core;
  2. import javax.servlet.ServletContext;
  3. /**
  4. * 促銷reload執行緒 參考亞太
  5. * 10分鐘reload
  6. */
  7. public class PromotionUpdateThread extends Thread {
  8. ServletContext m_application;
  9. public PromotionUpdateThread(ServletContext application) {
  10. m_application = application;
  11. }
  12. public void run() {
  13. while(true) {
  14. try {
  15. Thread.sleep( 10 * 60 * 1000);
  16. } catch (Exception e) {}
  17. try {
  18. PromotionMgr.backgroundLoad(m_application);
  19. } catch (Exception e) {
  20. e.printStackTrace();
  21. }
  22. }
  23. }
  24. }