Skip to content

Commit

Permalink
#925: submit_pending_jobs now also work for date range outside of his…
Browse files Browse the repository at this point in the history
…torical
  • Loading branch information
philipjyoon committed Jul 31, 2024
1 parent c850733 commit 3dc3bef
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions data_subscriber/submit_pending_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
import sys

from commons.logger import NoJobUtilsFilter, NoBaseFilter, NoLogUtilsFilter
from util.conf_util import SettingsConf
from data_subscriber.cmr import get_cmr_token
from data_subscriber.parser import create_parser
from data_subscriber.query import submit_download_job
from data_subscriber import es_conn_util
from cslc_utils import get_pending_download_jobs, localize_disp_frame_burst_hist, mark_pending_download_job_submitted, CSLCDependency
from data_subscriber.cslc.cslc_catalog import CSLCProductCatalog


from util.exec_util import exec_wrapper

logging.basicConfig(level="INFO")
Expand Down Expand Up @@ -47,6 +50,9 @@ def run(argv: list[str]):
es = es_conn_util.get_es_connection(logger)
es_conn = CSLCProductCatalog(logging.getLogger(__name__))

settings = SettingsConf().cfg
cmr, token, username, password, edl = get_cmr_token(query_args.endpoint, settings)

# Get unsubmitted jobs from Elasticsearch GRQ
unsubmitted = get_pending_download_jobs(es)
logger.info(f"Found {len(unsubmitted)=} Pending CSLC Download Jobs")
Expand All @@ -58,9 +64,7 @@ def run(argv: list[str]):
frame_id = job['_source']['frame_id']
acq_index = job['_source']['acq_index']

# While token, cmr, and settings are required parameters, they're not used for compressed_cslc_satisfied function
# those variables are used only to make cmr calls which we do not need to do here
cslc_dependency = CSLCDependency(k, m, disp_burst_map, query_args, None, None, None)
cslc_dependency = CSLCDependency(k, m, disp_burst_map, query_args, token, cmr, settings)

# Check if the compressed cslc has been generated
logger.info("Evaluating for frame_id: %s, acq_index: %s, k: %s, m: %s", frame_id, acq_index, k, m)
Expand Down

0 comments on commit 3dc3bef

Please sign in to comment.