Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Use gc.collect instead
Browse files Browse the repository at this point in the history
  • Loading branch information
AetherUnbound committed Jan 4, 2022
1 parent bdb11f0 commit 1c8f2db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ingestion_server/ingestion_server/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""

import datetime
import gc
import logging as log

import psycopg2
Expand Down Expand Up @@ -319,9 +320,9 @@ def reload_upstream(table, progress=None, finish_time=None, approach="advanced")
f"_Next: re-applying indices & constraints_"
)

# The server sometimes hangs on or before this next step. Adding this debug
# message here because apparently that unblocks it? May have to do with GC.
log.debug("Getting downstream cursor again")
# The server sometimes hangs on or before this next step. This is a pre-emptive
# garbage collection to try and assist with that.
gc.collect()
downstream_db = database_connect()
with downstream_db.cursor() as downstream_cur:
# Step 5: Recreate indices from the original table
Expand Down

0 comments on commit 1c8f2db

Please sign in to comment.