mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-19 10:19:27 -05:00
fix warnings about unclosed files.
This commit is contained in:
parent
a4277706f2
commit
60ac1ddbb9
@ -137,7 +137,8 @@ class Command(BaseCommand):
|
|||||||
f"Using inotify to watch directory for changes: {directory}")
|
f"Using inotify to watch directory for changes: {directory}")
|
||||||
|
|
||||||
inotify = INotify()
|
inotify = INotify()
|
||||||
descriptor = inotify.add_watch(directory, flags.CLOSE_WRITE | flags.MOVED_TO)
|
descriptor = inotify.add_watch(
|
||||||
|
directory, flags.CLOSE_WRITE | flags.MOVED_TO)
|
||||||
try:
|
try:
|
||||||
while not self.stop_flag:
|
while not self.stop_flag:
|
||||||
for event in inotify.read(timeout=1000, read_delay=1000):
|
for event in inotify.read(timeout=1000, read_delay=1000):
|
||||||
@ -147,3 +148,4 @@ class Command(BaseCommand):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
inotify.rm_watch(descriptor)
|
inotify.rm_watch(descriptor)
|
||||||
|
inotify.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user