From 2492473d48b57348d4b9d86be0d50467336a6efa Mon Sep 17 00:00:00 2001
From: Russell Jarvis <rjjarvis@asu.edu>
Date: Fri, 26 Jun 2020 15:44:33 +1000
Subject: [PATCH] for heroku

---
 science_access/get_bmark_corpus.py | 5 +++++
 science_access/scrape.py           | 4 +---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/science_access/get_bmark_corpus.py b/science_access/get_bmark_corpus.py
index 6fff696..f8e6933 100644
--- a/science_access/get_bmark_corpus.py
+++ b/science_access/get_bmark_corpus.py
@@ -37,6 +37,11 @@ def process(link):
         pdf_file = requests.get(link, stream=True)
         buffered = convert_pdf_to_txt(pdf_file)
     urlDat = text_proc(buffered,urlDat)
+    driver.close()
+    driver.quit() 
+    driver = None
+    del driver
+    
     return urlDat
 
 #try:
diff --git a/science_access/scrape.py b/science_access/scrape.py
index 2eb0894..57f71ae 100644
--- a/science_access/scrape.py
+++ b/science_access/scrape.py
@@ -55,7 +55,6 @@ if 'DYNO' in os.environ:
     heroku = False
 else:
     heroku = True
-'''    
 def get_driver():
     if 'DYNO' in os.environ:
         heroku = True
@@ -98,8 +97,7 @@ def get_driver():
     return driver
 
 
-driver = get_driver()
-'''
+#driver = get_driver()
 
 rsrcmgr = PDFResourceManager()
 retstr = StringIO()
-- 
GitLab