Skip to content

Commit 2bc7975

Browse files
committed
Added back in metadata, added try/except if it fails
1 parent 9a1b18f commit 2bc7975

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

config/cron_udp.hjson

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// and it wouldn’t reflect when the data was actually dumped from canvas.
66
// More info on UDP's batch-ingest DAG process can be found here: https://resources.unizin.org/display/UDP/Batch-ingest+application
77
'''
8-
SELECT * FROM EXTERNAL_QUERY("context_store", "select 'canvasdatadate' as pkey, min(dag_run) as pvalue from report.publish_info pi2");
8+
SELECT * FROM EXTERNAL_QUERY("us.context_store", "select 'canvasdatadate' as pkey, min(dag_run) as pvalue from report.publish_info pi2");
99
''',
1010
"user" :
1111
'''

dashboard/cron.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,10 @@ def update_unizin_metadata(self):
218218

219219
logger.debug(metadata_sql)
220220

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

223226
return status
224227

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

652655
# continue cron tasks
653-
654656
logger.info("** term")
655657
status += self.update_term()
656658

@@ -683,7 +685,7 @@ def do(self) -> str:
683685
exception_in_run = True
684686

685687
logger.info("** informational")
686-
# status += self.update_unizin_metadata()
688+
status += self.update_unizin_metadata()
687689

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

0 commit comments

Comments
 (0)