Browse Source

fix lint errors

Nick Sweeting 4 years ago
parent
commit
21bb84f627
2 changed files with 6 additions and 3 deletions
  1. 5 2
      archivebox/search/backends/sonic.py
  2. 1 1
      archivebox/system.py

+ 5 - 2
archivebox/search/backends/sonic.py

@@ -13,10 +13,13 @@ MAX_SONIC_TEXT_CHUNK_LENGTH = 2000          # dont index more than 2000 characte
 def index(snapshot_id: str, texts: List[str]):
     with IngestClient(SEARCH_BACKEND_HOST_NAME, SEARCH_BACKEND_PORT, SEARCH_BACKEND_PASSWORD) as ingestcl:
         for text in texts:
-            max_length = 1000000
             chunks = (
                 text[i:i+MAX_SONIC_TEXT_CHUNK_LENGTH]
-                for i in range(0, min(len(text), MAX_SONIC_TEXT_TOTAL_LENGTH), MAX_SONIC_TEXT_CHUNK_LENGTH)
+                for i in range(
+                    0,
+                    min(len(text), MAX_SONIC_TEXT_TOTAL_LENGTH),
+                    MAX_SONIC_TEXT_CHUNK_LENGTH,
+                )
             )
             for chunk in chunks:
                 ingestcl.push(SONIC_COLLECTION, SONIC_BUCKET, snapshot_id, str(chunk))

+ 1 - 1
archivebox/system.py

@@ -68,7 +68,7 @@ def run(*args, input=None, capture_output=True, timeout=None, check=False, text=
         # force kill any straggler subprocesses that were forked from the main proc
         try:
             os.killpg(pgid, signal.SIGINT)
-        except Exception as e:
+        except Exception:
             pass
 
     return CompletedProcess(process.args, retcode, stdout, stderr)