Skip to content

Commit

Permalink
throw exception if no work to do
Browse files Browse the repository at this point in the history
  • Loading branch information
frankhereford committed May 8, 2024
1 parent 2642593 commit df60832
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions atd-etl/cris_import/cris_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ def download_s3_archive():
cursor.execute("SELECT * FROM cris_import_log WHERE import_attempted is false")
uploads_to_import = cursor.fetchall()

# Check if there are no new files to process
if len(uploads_to_import) == 0:
raise Exception("No new files to process")

# Create a new temporary directory
import_dir = tempfile.mkdtemp()

Expand Down

0 comments on commit df60832

Please sign in to comment.