ChandimaPrabath commited on
Commit
e01cdb7
·
1 Parent(s): 703d0ec
Files changed (1) hide show
  1. LoadBalancer.py +11 -0
LoadBalancer.py CHANGED
@@ -129,6 +129,17 @@ class LoadBalancer:
129
  with open(actual_file_path, 'w') as actual_file:
130
  json.dump(temp_data, actual_file, indent=2)
131
 
 
 
 
 
 
 
 
 
 
 
 
132
  ######################################################################
133
 
134
  @staticmethod
 
129
  with open(actual_file_path, 'w') as actual_file:
130
  json.dump(temp_data, actual_file, indent=2)
131
 
132
+ def start_polling(self):
133
+ logging.info("Starting polling.")
134
+ while not self.stop_event.is_set():
135
+ self.get_reports()
136
+ time.sleep(self.polling_interval)
137
+ logging.info("Polling stopped.")
138
+
139
+ def stop_polling(self):
140
+ logging.info("Stopping polling.")
141
+ self.stop_event.set()
142
+
143
  ######################################################################
144
 
145
  @staticmethod