Commit 067ba1ad authored by Jondy Zhao's avatar Jondy Zhao

netdrive: change sleep interval

parent c684523c
......@@ -117,12 +117,13 @@ class NetDriveUsageReporter(object):
self.sendAllReport()
self.initializeConnection()
last_timestamp = datetime.now()
interval = 30.0 if self.report_interval > 60 else (self.report_interval / 2)
try:
while True:
current_timestamp = datetime.now()
d = current_timestamp - last_timestamp
if d.seconds < self.report_interval:
sleep(self.report_interval)
sleep(interval)
continue
self.insertUsageReport(last_timestamp.isoformat(), d.seconds)
self.sendReport()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment