updated the time checking for demos
This commit is contained in:
parent
547b6c3bc7
commit
74cc467757
@ -9,7 +9,13 @@ class local_dir_remote:
|
||||
|
||||
def list_dir(self):
|
||||
path = Path(self.path)
|
||||
return list(path.glob('*'))
|
||||
file_list = []
|
||||
delta = timedelta(minutes=5)
|
||||
for file_demo in list(path.glob('*')):
|
||||
mtime = datetime.fromtimestamp(os.stat(file_demo).st_mtime)
|
||||
if mtime < datetime.now() - delta:
|
||||
file_list.append(file_demo)
|
||||
return file_list
|
||||
|
||||
def delete_local(self, pathfile):
|
||||
with contextlib.suppress(FileNotFoundError):
|
||||
|
Loading…
Reference in New Issue
Block a user