aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Ionite <[email protected]>2023-03-16 00:05:05 -0400
committerGravatar Ionite <[email protected]>2023-03-16 00:05:05 -0400
commite9242175ced6584084b6a4a1c77d0319b49e2cc0 (patch)
treeeeee9025274f97ba99df46ed26a70581fecea837
parentUse log.exception for catch all (diff)
Rename `count` variable
-rw-r--r--snekbox/memfs.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/snekbox/memfs.py b/snekbox/memfs.py
index 57ba69c..c340146 100644
--- a/snekbox/memfs.py
+++ b/snekbox/memfs.py
@@ -142,7 +142,7 @@ class MemFS:
a TimeoutError will be raised.
"""
start_time = time.monotonic()
- added = 0
+ count = 0
files = glob.iglob(pattern, root_dir=str(self.output), recursive=True, include_hidden=False)
for file in (Path(self.output, f) for f in files):
if timeout and (time.monotonic() - start_time) > timeout:
@@ -158,11 +158,11 @@ class MemFS:
log.info(f"Skipping {file.name!r} as it has not been modified")
continue
- if added > limit:
+ if count > limit:
log.info(f"Max attachments {limit} reached, skipping remaining files")
break
- added += 1
+ count += 1
log.info(f"Found valid file for upload {file.name!r}")
yield FileAttachment.from_path(file, relative_to=self.output)