mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Handle a possible suck-100%-cpu bug if drivers._drivers contains only the schedule driver.
This commit is contained in:
parent
f2bb0c0125
commit
86eb377442
@ -97,6 +97,8 @@ class Schedule(drivers.IrcDriver):
|
|||||||
removePeriodicEvent = removeEvent
|
removePeriodicEvent = removeEvent
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
if len(drivers._drivers) == 1:
|
||||||
|
time.sleep(1) # We're the only driver; let's pause to think.
|
||||||
while self.schedule and self.schedule[0][0] < time.time():
|
while self.schedule and self.schedule[0][0] < time.time():
|
||||||
(t, name) = heapq.heappop(self.schedule)
|
(t, name) = heapq.heappop(self.schedule)
|
||||||
f = self.events[name]
|
f = self.events[name]
|
||||||
|
Loading…
Reference in New Issue
Block a user