telekom / spider-scrape

MIT License
1 stars 0 forks source link

Should this be without the `closing_cursor`? #2

Open PhilipMay opened 1 year ago

PhilipMay commented 1 year ago

https://github.com/telekom/spider-scrape/blob/e6cadb3bc82d9dfdfbd2e9949baa90ea15ec7743/spider_scrape/arango_db.py#L42

just:

            with closing(cursor):
PhilipMay commented 1 year ago

Or even better this?

        try:
            for doc in tqdm(cursor):
                data.extend(extract_doc(doc))
        finally:
            cursor.close(ignore_missing=True)