Skip to content

Commit

Permalink
Added back in metadata, added try/except if it fails
Browse files Browse the repository at this point in the history
  • Loading branch information
jonespm committed Aug 28, 2024
1 parent 9a1b18f commit 2bc7975
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/cron_udp.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// and it wouldn’t reflect when the data was actually dumped from canvas.
// More info on UDP's batch-ingest DAG process can be found here: https://resources.unizin.org/display/UDP/Batch-ingest+application
'''
SELECT * FROM EXTERNAL_QUERY("context_store", "select 'canvasdatadate' as pkey, min(dag_run) as pvalue from report.publish_info pi2");
SELECT * FROM EXTERNAL_QUERY("us.context_store", "select 'canvasdatadate' as pkey, min(dag_run) as pvalue from report.publish_info pi2");
''',
"user" :
'''
Expand Down
8 changes: 5 additions & 3 deletions dashboard/cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@ def update_unizin_metadata(self):

logger.debug(metadata_sql)

status += self.util_function(metadata_sql, 'unizin_metadata')
try:
status += self.util_function(metadata_sql, 'unizin_metadata')
except Exception as e:
logger.warn(f"Could not directly access metadata, this is likely just an issue when using synthetic data.")

return status

Expand Down Expand Up @@ -650,7 +653,6 @@ def do(self) -> str:
logger.info(f'Valid locked course IDs: {self.valid_locked_course_ids}')

# continue cron tasks

logger.info("** term")
status += self.update_term()

Expand Down Expand Up @@ -683,7 +685,7 @@ def do(self) -> str:
exception_in_run = True

logger.info("** informational")
# status += self.update_unizin_metadata()
status += self.update_unizin_metadata()

all_str_course_ids = set(
str(x) for x in Course.objects.get_supported_courses().values_list('id', flat=True)
Expand Down

0 comments on commit 2bc7975

Please sign in to comment.