Skip to content

Commit 41909ef

Browse files
committed
change global var so it doesn't replicate constants convention
1 parent 2755807 commit 41909ef

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

prepline_general/api/general.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
app = FastAPI()
5555
router = APIRouter()
5656

57-
IS_CHIPPER_PROCESSING = False
57+
Is_Chipper_Processing = False
5858

5959
DEFAULT_MIMETYPES = (
6060
"application/pdf,application/msword,image/jpeg,image/png,text/markdown,"
@@ -109,7 +109,7 @@ def get_pdf_splits(pdf_pages: List[PageObject], split_size: int = 1):
109109
for page in pdf_pages[offset:end]:
110110
new_pdf.add_page(page)
111111

112-
new_pdf.write(pdf_buffer)
112+
new_pdf.write(pdf_buffer) # type: ignore
113113
pdf_buffer.seek(0)
114114

115115
yield (pdf_buffer.read(), offset)
@@ -255,19 +255,19 @@ class ChipperMemoryProtection:
255255
"""
256256

257257
def __enter__(self):
258-
global IS_CHIPPER_PROCESSING
259-
if IS_CHIPPER_PROCESSING:
258+
global Is_Chipper_Processing
259+
if Is_Chipper_Processing:
260260
# Log here so we can track how often it happens
261261
logger.error("Chipper is already is use")
262262
raise HTTPException(
263263
status_code=503, detail="Server is under heavy load. Please try again later."
264264
)
265265

266-
IS_CHIPPER_PROCESSING = True
266+
Is_Chipper_Processing = True
267267

268268
def __exit__(self, exc_type, exc_value, exc_tb):
269-
global IS_CHIPPER_PROCESSING
270-
IS_CHIPPER_PROCESSING = False
269+
global Is_Chipper_Processing
270+
Is_Chipper_Processing = False
271271

272272

273273
def pipeline_api(

0 commit comments

Comments
 (0)