code review

pull/716/head
sebres 2014-10-26 22:14:57 +01:00
parent 361c220846
commit 286ef6aa87
2 changed files with 12 additions and 10 deletions

View File

@ -324,7 +324,7 @@ class Actions(JailThread, Mapping):
datetime.datetime.fromtimestamp(bendtime).strftime("%Y-%m-%d %H:%M:%S"))
# check ban is not too old :
if bendtime < MyTime.time():
logSys.info('[%s] Ignore %s, expiered bantime - %s', self._jail.name, ip, logtime[1])
logSys.info('[%s] Ignore %s, expired bantime - %s', self._jail.name, ip, logtime[1])
return False
else:
logtime = ('permanent', 'infinite')

View File

@ -245,6 +245,7 @@ class ObserverThread(JailThread):
logSys.info("Observer stop ... try to end queue %s seconds", wtime)
#print("Observer stop ....")
# just add shutdown job to make possible wait later until full (events remaining)
with self._queue_lock:
self.add_wn('shutdown')
#don't pulse - just set, because we will delete it hereafter (sometimes not wakeup)
n = self._notify
@ -269,6 +270,7 @@ class ObserverThread(JailThread):
if sleeptime is not None:
e = MyTime.time() + sleeptime
# block queue with not operation to be sure all really jobs are executed if nop goes from queue :
if self._notify is not None:
self.add_wn('nop')
if self.is_full and self.idle:
self.pulse_notify()