Skip to content

Commit

Permalink
Lazily load tasks to save RAM
Browse files Browse the repository at this point in the history
  • Loading branch information
omad committed Jun 11, 2020
1 parent 0cbe24a commit 429e048
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions dea_cogger/cog_conv_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,11 @@ def mpi_convert(product_name, output_dir, config, filelist):

try:
with open(filelist) as fl:
reader = csv.reader(fl)
tasks = list(reader)
tasks = csv.reader(fl)
except FileNotFoundError:
LOG.error('Task file not found.', filepath=filelist)
sys.exit(1)

if len(tasks) == 0:
LOG.warning('Task file is empty. Aborting.')
sys.exit(1)

LOG.info('Successfully loaded configuration file', config=config, taskfile=filelist)

product_config = config['products'][product_name]
Expand Down

0 comments on commit 429e048

Please sign in to comment.