ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/host/java/SystemMonitor.java
(Generate patch)

Comparing projects/cms/source/host/java/SystemMonitor.java (file contents):
Revision 1.3 by ab11, Thu Nov 30 04:11:00 2000 UTC vs.
Revision 1.4 by ab11, Thu Nov 30 17:33:36 2000 UTC

# Line 36 | Line 36 | class SystemMonitor {
36  
37          // why oh why wont ultra edit let me put Long in the next line? oh its trying to
38          // correct keywords =|
39 <        checkInterval = Long.parseLong(config.getProperty("UDPUpdateTime")) * 1000;
39 >        try {
40 >                udpcheckInterval = Long.parseLong(config.getProperty("UDPUpdateTime")) * 1000;
41 >        }
42 >        catch ( NumberFormatException e ){
43 >                System.out.println("The value for UDPUpdateTime is invalid, using a default");
44 >                // 5 mins
45 >                udpcheckInterval = 5000 * 60;
46 >        }
47          // make the check interval into seconds
48          
49      }
# Line 71 | Line 78 | class SystemMonitor {
78          }
79          // MUST FIX THIS..!!!!
80          try {
81 <                Thread.sleep(( lastCheck + checkInterval )-System.currentTimeMillis());
81 >                long updateIn = ( lastCheck + udpcheckInterval )-System.currentTimeMillis();
82 >                if ( updateIn > 0 ){
83 >                        Thread.sleep(updateIn);
84 >                }
85 >                else
86 >                {
87 >                        Thread.sleep(defaultUpdateTime);
88 >                }
89          }
90          catch( InterruptedException e ){
91                  System.out.println("Sleep interrupted");
# Line 93 | Line 107 | class SystemMonitor {
107  
108      private long lastCheck;
109      private int sequence;
110 <    private long checkInterval;
110 >    private long udpcheckInterval;
111 >    private final long defaultUpdateTime = 60000;
112  
113   //---STATIC ATTRIBUTES---
114  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines