mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 15:08:40 +00:00
The !FreeSpace plugin only calculates free-space on existing directories. Cleaned-up logging.
This commit is contained in:
parent
177ec7d5c2
commit
eee6d4c030
1 changed files with 11 additions and 9 deletions
|
@ -113,10 +113,11 @@ class Core(CorePluginBase):
|
||||||
self._cleanup.stop()
|
self._cleanup.stop()
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
log.debug('\n\nUpdating %s FreeSpace', self.__class__.__name__)
|
log.debug('Updating %s FreeSpace', self.__class__.__name__)
|
||||||
nots = {}
|
nots = {}
|
||||||
for path in self.__gather_paths_to_check():
|
for path in self.__gather_paths_to_check():
|
||||||
log.debug("Checking path %s", path)
|
log.debug("Checking path %s", path)
|
||||||
|
if os.path.exists(path):
|
||||||
free_percent = self.__get_free_space(path)
|
free_percent = self.__get_free_space(path)
|
||||||
if (100 - free_percent) > self.config['percent']:
|
if (100 - free_percent) > self.config['percent']:
|
||||||
if path not in self.notifications_sent:
|
if path not in self.notifications_sent:
|
||||||
|
@ -124,7 +125,8 @@ class Core(CorePluginBase):
|
||||||
nots[path] = (100 - free_percent)
|
nots[path] = (100 - free_percent)
|
||||||
else:
|
else:
|
||||||
log.warning("Running low on disk space on %s but "
|
log.warning("Running low on disk space on %s but "
|
||||||
"notifications were already triggered.", path)
|
"notifications were already triggered.",
|
||||||
|
path)
|
||||||
if nots:
|
if nots:
|
||||||
component.get("EventManager").emit(LowDiskSpaceEvent(nots))
|
component.get("EventManager").emit(LowDiskSpaceEvent(nots))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue