mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-13 03:08:14 +00:00
Fix certificate watch
In python3, it was not working. If another file got added, it could go with a busy loop.
This commit is contained in:
parent
0800290c8e
commit
213d440052
@ -473,9 +473,10 @@ class SockApi(object):
|
||||
def watch_for_cert(self):
|
||||
libc = ctypes.CDLL(ctypes.util.find_library('c'))
|
||||
watcher = libc.inotify_init()
|
||||
if libc.inotify_add_watch(watcher, '/etc/confluent/', 0x100) > -1:
|
||||
if libc.inotify_add_watch(watcher, b'/etc/confluent/', 0x100) > -1:
|
||||
while True:
|
||||
select.select((watcher,), (), (), 86400)
|
||||
os.read(watcher, 1024)
|
||||
if self.should_run_remoteapi():
|
||||
os.close(watcher)
|
||||
self.start_remoteapi()
|
||||
|
Loading…
x
Reference in New Issue
Block a user