1
0
mirror of https://github.com/thingsboard/thingsboard-gateway synced 2025-10-26 22:31:42 +08:00

Added check for rescanning files in the path

This commit is contained in:
samson0v
2021-08-11 16:37:37 +03:00
parent c86c04ac6b
commit 3030dfd4f6
2 changed files with 8 additions and 1 deletions

View File

@@ -134,7 +134,10 @@ class FTPConnector(Connector, Thread):
configuration = path.config
converter = FTPUplinkConverter(configuration)
path.last_polled_time = time_point
# TODO: check if to rescan path
if '*' in path.path:
path.find_files(ftp)
for file in path.files:
current_hash = file.get_current_hash(ftp)
if ((file.has_hash() and current_hash != file.hash) or not file.has_hash()) and file.check_size_limit(

View File

@@ -168,6 +168,10 @@ class Path:
def last_polled_time(self):
return self._last_polled_time
@property
def path(self):
return self._path
@property
def poll_period(self):
return self._poll_period